moved hold notify email generation to a setting in the config
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 2 Sep 2006 18:39:31 +0000 (18:39 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 2 Sep 2006 18:39:31 +0000 (18:39 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5864 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Circ/Circulate.pm
Open-ILS/src/perlmods/OpenILS/Application/Circ/HoldNotify.pm

index c271ce4..25e6d6f 100644 (file)
@@ -1367,10 +1367,7 @@ sub do_hold_notify {
 
                $logger->info("attempt at sending hold notification for hold $holdid");
 
-               # XXX uncomment me to send email notifications
-               #my $stat = $notifier->send_email_notify;
-               my $stat = 0;
-
+               my $stat = $notifier->send_email_notify;
                $logger->info("hold notify succeeded for hold $holdid") if $stat eq '1';
                $logger->warn(" * hold notify failed for hold $holdid") if $stat ne '1';
 
index 4912808..841a3b8 100644 (file)
@@ -108,6 +108,17 @@ sub new {
 sub send_email_notify {
        my $self = shift;
 
+       my $sc = OpenSRF::Utils::SettingsClient->new;
+       my $setting = $sc->config_value(
+               qw/ apps open-ils.circ app_settings notify_hold email / );
+
+       $logger->debug("hold_notify: email enabled setting = $setting");
+
+       if( !$setting or $setting ne 'true' ) {
+               $logger->info("hold_notify: not sending hold notify - email notifications disabled");
+               return 0;
+       }
+
        $logger->info("hold_notify: attempting email notify on hold ".$self->hold->id);
 
        return OpenILS::Event->new('PATRON_NO_EMAIL_ADDRESS')