From 53e331baffa0ac5d659c347018720f7a1ee97c9b Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 9 Dec 2019 23:06:06 +0000 Subject: [PATCH] Bug 24197: Added new local use syspref which sets the email address that failed overdue notices are set to. Test plan: 1. Set an email in KohaAdminEmailAddress and notice there is no syspref named RedirectAddressForFailedOverdueNotices 2. Set some invalid email addresses in patron records then checkout items to those patrons making the due date in the past 3. Manually run overdue_notices.pl 4. Check the message_queue database table and notice the patrons with invalid email addresses are in an email starting with the content: 'These messages were not sent directly to the patrons.' 5. Apply patch 6. Run database update: cd installer/data/mysql sudo koha-shell ./updatedb.pl 7. Confirm there is a new system preference named: RedirectAddressForFailedOverdueNotices Give it a different email address to that in the KohaAdminEmailAddress syspref. 7. Repeat steps 2-4 and notice that the failed overdue notices have been sent to the email defined in RedirectAddressForFailedOverdueNotices Sponsored-By: Catalyst IT --- .../bug_24197-new_RedirectAddressForFailedOverdueNotices_syspref.sql | 1 + koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref | 5 +++++ misc/cronjobs/overdue_notices.pl | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24197-new_RedirectAddressForFailedOverdueNotices_syspref.sql diff --git a/installer/data/mysql/atomicupdate/bug_24197-new_RedirectAddressForFailedOverdueNotices_syspref.sql b/installer/data/mysql/atomicupdate/bug_24197-new_RedirectAddressForFailedOverdueNotices_syspref.sql new file mode 100644 index 0000000000..9985656a64 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_24197-new_RedirectAddressForFailedOverdueNotices_syspref.sql @@ -0,0 +1 @@ +INSERT INGORE INTO systempreferences (variable, value, options, explanation, type) VALUES ('RedirectAddressForFailedOverdueNotices', '', NULL, 'Destination email for failed overdue notices. If left empty then the branch email or KohaAdminEmailAddress syspref will be the email address that failed overdue notices are sent to', 'free'); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref index 00fba12baf..08362c6ace 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -21,6 +21,11 @@ Administration: class: email - "(Leave this field empty to send messages to their normal recipient)" - + - "Email address failed overdue notices are sent to: " + - pref: RedirectAddressForFailedOverdueNotices + class: email + - "If left empty then the branch email or KohaAdminEmailAddress will be set as the destination address for failed overdue notices" + - - "How much debugging information to show in the browser when an internal error occurs: " - pref: DebugLevel default: 0 diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl index 75fd593c77..a1a0b5b39e 100755 --- a/misc/cronjobs/overdue_notices.pl +++ b/misc/cronjobs/overdue_notices.pl @@ -821,7 +821,7 @@ END_SQL borrowernumber => undef, message_transport_type => 'email', attachments => [$attachment], - to_address => $admin_email_address, + to_address => C4::Context->preference('RedirectAddressForFailedOverdueNotices'), } ) unless $test_mode; } -- 2.11.0