added support for using the org-unit setting for FROM address
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Aug 2008 20:55:11 +0000 (20:55 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Aug 2008 20:55:11 +0000 (20:55 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@10408 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/support-scripts/generate_circ_notices.pl

index b430286..935e97b 100755 (executable)
@@ -240,12 +240,20 @@ sub generate_notice {
         notifications => $type => 'sender_address') || 
         $settings->config_value(notifications => 'sender_address');
 
+    # see if there is a configured bounce address for this org unit.
+    # if so, use that as the sender
+       if(my $set = $e->search_actor_org_unit_setting( 
+                       {name => 'org.bounced_emails', org_unit => $circ_list->[0]->circ_lib->id} )->[0]) {
+               my $bemail = OpenSRF::Utils::JSON->JSON2perl($set->value);
+               $sender = $bemail if $bemail;
+       }
+
+
     my $context = {   
         circ_list => $circ_list,
         get_bib_attr => \&get_bib_attr,
         parse_due_date => \&parse_due_date, # let the templates decide date format
         smtp_sender => $sender,
-        smtp_repley => $sender, # XXX
         notice => $notice,
     };