diff --git a/C4/Reserves.pm b/C4/Reserves.pm index a4cfc7cb50..667020adef 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -1776,8 +1776,9 @@ sub _koha_notify_reserve { message_name => 'Hold_Filled' } ); - my $library = Koha::Libraries->find( $hold->branchcode ); - my $from_email_address = $library->from_email_address; + my $library = Koha::Libraries->find( $hold->branchcode ); + my $from_email_address = $library->from_email_address; + my $reply_email_address = $library->inbound_email_address; my %letter_params = ( module => 'reserves', @@ -1812,6 +1813,7 @@ sub _koha_notify_reserve { letter => $letter, borrowernumber => $borrowernumber, from_address => $from_email_address, + reply_address => $reply_email_address, message_transport_type => $mtt, } ); diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t index 616506b9b7..12538a4888 100755 --- a/t/db_dependent/Reserves.t +++ b/t/db_dependent/Reserves.t @@ -715,7 +715,7 @@ $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); subtest '_koha_notify_reserve() tests' => sub { - plan tests => 3; + plan tests => 4; my $branch = $builder->build_object({ class => 'Koha::Libraries', @@ -797,9 +797,14 @@ subtest '_koha_notify_reserve() tests' => sub { borrowernumber => $hold_borrower, })->next(); my $email_to_address = $email->to_address(); - is($email_to_address, undef ,"We should not populate the hold message with the email address, sending will do so"); + is( + $email_to_address, undef, + "We should not populate the hold message with the email address, sending will do so" + ); my $email_from_address = $email->from_address(); - is($email_from_address,'branch@e.mail',"Library's from address is used for sending"); + is( $email_from_address, 'branch@e.mail', "Library's from address is used for sending" ); + my $email_reply_address = $email->reply_address(); + is( $email_reply_address, 'branch@reply.to', "Library's reply address is used for reply" ); };