@@ -, +, @@ address that failed overdue notices are set to. --- ...bug_24197-new_RedirectAddressForFailedOverdueNotices_syspref.sql | 1 + installer/data/mysql/sysprefs.sql | 1 + .../intranet-tmpl/prog/en/modules/admin/preferences/admin.pref | 6 ++++++ misc/cronjobs/overdue_notices.pl | 4 +++- 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_24197-new_RedirectAddressForFailedOverdueNotices_syspref.sql --- a/installer/data/mysql/atomicupdate/bug_24197-new_RedirectAddressForFailedOverdueNotices_syspref.sql +++ a/installer/data/mysql/atomicupdate/bug_24197-new_RedirectAddressForFailedOverdueNotices_syspref.sql @@ -0,0 +1, @@ +INSERT IGNORE 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'); --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -529,6 +529,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('QuoteOfTheDay','','intranet,opac','Enable or disable display of Quote of the Day on the OPAC and staff interface home page','multiple'), ('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'), ('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'), +('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'), ('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'), ('RenewAccruingItemWhenPaid','0','','If enabled, when the fines on an item accruing is paid off, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'), ('RenewAccruingItemInOpac','0','','If enabled, when the fines on an item accruing is paid off in the OPAC via a payment plugin, attempt to renew that item. If the syspref "RenewalPeriodBase" is set to "due date", renewed items may still be overdue','YesNo'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -21,6 +21,12 @@ 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 --- a/misc/cronjobs/overdue_notices.pl +++ a/misc/cronjobs/overdue_notices.pl @@ -455,7 +455,8 @@ foreach my $branchcode (@branches) { my $library = Koha::Libraries->find($branchcode); my $admin_email_address = $library->branchemail || C4::Context->preference('KohaAdminEmailAddress'); - my $branch_email_address = $library->inbound_email_address; + my $branch_email_address = C4::Context->preference('RedirectAddressForFailedOverdueNotices') + || $library->inbound_email_address; my @output_chunks; # may be sent to mail or stdout or csv file. $verbose and warn sprintf "branchcode : '%s' using %s\n", $branchcode, $branch_email_address; @@ -817,6 +818,7 @@ END_SQL title => 'Overdue Notices', content => 'These messages were not sent directly to the patrons.', }; + C4::Letters::EnqueueLetter( { letter => $letter, borrowernumber => undef, --