From deade184c3d9b40fb3fe17fe16ce9ac500855dc8 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 --- 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.20.1