From b8b2301f1320c2b7978b202cd1d196ae838dd8b5 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 19 Mar 2020 00:26:33 +0000 Subject: [PATCH] Bug 4461: Checks on library email before enqueuing letter Signed-off-by: David Nind Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize --- opac/opac-reportproblem.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/opac/opac-reportproblem.pl b/opac/opac-reportproblem.pl index 4f5ce5e3c2..0df2c73772 100755 --- a/opac/opac-reportproblem.pl +++ b/opac/opac-reportproblem.pl @@ -97,12 +97,13 @@ if ( $op eq 'addreport' ) { my $transport = 'email'; my $reply_address = $patron->email || $patron->emailpro || $patron->B_email; - if ( $recipient eq 'admin' ) { + if ( $recipient eq 'library' and defined($library->get_effective_email) and $library->get_effective_email ne C4::Context->preference('KohaAdminEmailAddress') ) { + # the problem report is intended for a librarian and will be received at a library email address C4::Letters::EnqueueLetter({ letter => $letter, borrowernumber => $borrowernumber, message_transport_type => $transport, - to_address => C4::Context->preference('KohaAdminEmailAddress'), + to_address => $library->get_effective_email, reply_address => $reply_address, }); } else { @@ -110,7 +111,7 @@ if ( $op eq 'addreport' ) { letter => $letter, borrowernumber => $borrowernumber, message_transport_type => $transport, - to_address => $library->get_effective_email, + to_address => C4::Context->preference('KohaAdminEmailAddress'), reply_address => $reply_address, }); } -- 2.39.5