@@ -, +, @@ --- C4/Reserves.pm | 2 +- Koha/Illrequest.pm | 4 ++-- circ/pendingreserves.pl | 4 ++-- misc/cronjobs/notice_unprocessed_suggestions.pl | 6 +----- misc/cronjobs/overdue_notices.pl | 3 +-- suggestion/suggestion.pl | 6 +----- 6 files changed, 8 insertions(+), 17 deletions(-) --- a/C4/Reserves.pm +++ a/C4/Reserves.pm @@ -1849,7 +1849,7 @@ sub _koha_notify_reserve { my $library = Koha::Libraries->find( $hold->branchcode )->unblessed; - my $admin_email_address = $library->{branchemail} || C4::Context->preference('KohaAdminEmailAddress'); + my $admin_email_address = $library->from_email_address; my %letter_params = ( module => 'reserves', --- a/Koha/Illrequest.pm +++ a/Koha/Illrequest.pm @@ -1335,7 +1335,7 @@ sub generic_confirm { "No target email addresses found. Either select at least one partner or check your ILL partner library records.") if ( !$to ); # Create the from, replyto and sender headers - my $from = $branch->branchemail; + my $from = $branch->from_email_address; my $replyto = $branch->inbound_ill_address; Koha::Exceptions::Ill::NoLibraryEmail->throw( "Your library has no usable email address. Please set it.") @@ -1427,7 +1427,7 @@ sub send_patron_notice { # Notice should come from the library where the request was placed, # not the patrons home library my $branch = Koha::Libraries->find($self->branchcode); - my $from_address = $branch->branchemail; + my $from_address = $branch->from_email_address; my $reply_address = $branch->inbound_ill_address; # Send the notice to the patron via the chosen transport methods --- a/circ/pendingreserves.pl +++ a/circ/pendingreserves.pl @@ -86,13 +86,13 @@ if ( $op eq 'cancel_reserve' and $reserve_id ) { }, ); if ( $letter ) { - my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress'); + my $from_address = $library->from_email_address; C4::Letters::EnqueueLetter( { letter => $letter, borrowernumber => $patron->borrowernumber, message_transport_type => 'email', - from_address => $admin_email_address, + from_address => $from_address, } ); unless ( $patron->notice_email_address ) { --- a/misc/cronjobs/notice_unprocessed_suggestions.pl +++ a/misc/cronjobs/notice_unprocessed_suggestions.pl @@ -48,9 +48,6 @@ for my $number_of_days (@days) { my $budget = C4::Budgets::GetBudget( $suggestion->{budgetid} ); my $patron = Koha::Patrons->find( $budget->{budget_owner_id} ); my $email_address = $patron->notice_email_address; - my $library = $patron->library; - my $admin_email_address = $library->branchemail - || C4::Context->preference('KohaAdminEmailAddress'); if ($email_address) { say "Patron " . $patron->borrowernumber . " is going to be notified" if $verbose; @@ -70,8 +67,7 @@ for my $number_of_days (@days) { { letter => $letter, borrowernumber => $patron->borrowernumber, - message_transport_type => 'email', - from_address => $admin_email_address, + message_transport_type => 'email' } ); } --- a/misc/cronjobs/overdue_notices.pl +++ a/misc/cronjobs/overdue_notices.pl @@ -469,8 +469,7 @@ foreach my $branchcode (@branches) { } my $library = Koha::Libraries->find($branchcode); - my $admin_email_address = $library->branchemail - || C4::Context->preference('KohaAdminEmailAddress'); + my $admin_email_address = $library->from_email_address my $branch_email_address = C4::Context->preference('AddressForFailedOverdueNotices') || $library->inbound_email_address; my @output_chunks; # may be sent to mail or stdout or csv file. --- a/suggestion/suggestion.pl +++ a/suggestion/suggestion.pl @@ -188,9 +188,6 @@ if ( $op =~ /save/i ) { my $patron = Koha::Patrons->find( $suggestion_only->{managedby} ); my $email_address = $patron->notice_email_address; if ($patron->notice_email_address) { - my $library = $patron->library; - my $admin_email_address = $library->branchemail - || C4::Context->preference('KohaAdminEmailAddress'); my $letter = C4::Letters::GetPreparedLetter( module => 'suggestions', @@ -207,8 +204,7 @@ if ( $op =~ /save/i ) { { letter => $letter, borrowernumber => $patron->borrowernumber, - message_transport_type => 'email', - from_address => $admin_email_address, + message_transport_type => 'email' } ); } --