Bug 31281: Use correct reply-to email when sending overdue mails

Overdue emails are either sent from the issuing or the home
library of an item. We never use the patron's home library,
so the reply-to address must explicitly be set in EnqueueLetter.

To test:
- Set up 2 branches (A and B) with different email addresses.
- Set up an SMTP server for each to use
- Set up an overdue notice trigger for the patron category you'll use
  First letter: 1 day delay, any notice
- Check out an item with home branch B to a patron from A
- Run the the script with:
  overdue_notices.pl -t --frombranch item-homebranch
  overdue_notices.pl -t --frombranch item-issuebranch
- Confirm for each setting that the correct email headers have been
  used. You can see the reply-to address and to-address in the
  message queue:
  SELECT * FROM message_queue;

Signed-off-by: Nason Bimbe <nason.bimbe@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 18b2389de4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Katrin Fischer 2022-08-07 16:14:37 +00:00 committed by Lucas Gass
parent 5acbdfe054
commit bc724da289

View file

@ -803,6 +803,7 @@ END_SQL
message_transport_type => $effective_mtt,
from_address => $admin_email_address,
to_address => join(',', @emails_to_use),
reply_address => $library->inbound_email_address,
}
) unless $test_mode;
# A print notice should be sent only once per overdue level.