From 67f229cba7395485a22fc0effa67ca4f592408f4 Mon Sep 17 00:00:00 2001 From: Southeastern University Date: Thu, 7 Aug 2008 21:38:06 -0400 Subject: [PATCH] Add missing to and from email addresses to user and admin EnqueueLetter calls, respectively. Add extra level to verbosity. Signed-off-by: Joshua Ferraro --- misc/cronjobs/overdue_notices.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 64e372214e..532215dbfb 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -53,6 +53,7 @@ overdue_notices.pl [ -n ] [ -library ] [ -max ] [ -library only deal with overdues from this library -csv populate CSV file -itemscontent item information in templates + -v verbose ( use multiple times to increase verbosity ) =head1 OPTIONS @@ -218,7 +219,7 @@ my $itemscontent = join( ',', qw( issuedate title barcode author ) ); GetOptions( 'help|?' => \$help, 'man' => \$man, - 'v' => \$verbose, + 'v+' => \$verbose, 'n' => \$nomail, 'max=s' => \$MAX, 'library=s' => \$mybranch, @@ -227,7 +228,6 @@ GetOptions( ) or pod2usage(2); pod2usage(1) if $help; pod2usage( -verbose => 2 ) if $man; - if ( defined $csvfilename && $csvfilename =~ /^-/ ) { warn qq(using "$csvfilename" as filename, that seems odd); } @@ -339,10 +339,10 @@ END_SQL push @borrower_parameters, $mindays, $maxdays; my $sth = $dbh->prepare($borrower_sql); $sth->execute(@borrower_parameters); - $verbose and warn $borrower_sql . "\n\n ($mindays, $maxdays)\nreturns " . $sth->rows . " rows"; + ($verbose>1) and warn $borrower_sql . "\n\n ($mindays, $maxdays)\nreturns " . $sth->rows . " rows"; while ( my ( $itemcount, $borrowernumber, $firstname, $lastname, $address1, $address2, $city, $postcode, $email ) = $sth->fetchrow ) { - warn "borrower $firstname, $lastname ($borrowernumber) has $itemcount items overdue." if $verbose; + warn "borrower $firstname, $lastname ($borrowernumber) [ $email ] has $itemcount items overdue." if $verbose; my $letter = C4::Letters::getletter( 'circulation', $overdue_rules->{"letter$i"} ); unless ($letter) { @@ -409,6 +409,7 @@ END_SQL { letter => $letter, borrowernumber => $borrowernumber, message_transport_type => 'email', + to_address => $email, from_address => $admin_email_address, } ); @@ -464,6 +465,7 @@ END_SQL message_transport_type => 'email', attachments => [$attachment], to_address => $admin_email_address, + from_address => $admin_email_address, } ); } -- 2.39.5