From ae9d9cd68b9c12772ecac41682dd9e61430726db Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 25 Feb 2020 11:14:12 +0000 Subject: [PATCH] Bug 24723: Update EmailPurchaseSuggestions to use effective_email This patch updates the EmailPurchaseSuggestions functionality to use the get_effective_email method to obtain the correct email address for a branch when it is set to BranchEmail --- C4/Suggestions.pm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index 8157e59024..ff6147b183 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -473,11 +473,7 @@ sub NewSuggestion { if ( $emailpurchasesuggestions eq "BranchEmailAddress" ) { my $library = Koha::Libraries->find( $full_suggestion->{branchcode} ); - $toaddress = - $library->branchreplyto - || $library->branchemail - || C4::Context->preference('ReplytoDefault') - || C4::Context->preference('KohaAdminEmailAddress'); + $toaddress = $library->get_effective_email; } elsif ( $emailpurchasesuggestions eq "KohaAdminEmailAddress" ) { $toaddress = C4::Context->preference('ReplytoDefault') -- 2.20.1