Bug 29704

Summary: Holds reminder emails should allow configuration for a specific number of days
Product: Koha Reporter: Andrew Fuerste-Henry <andrew>
Component: Hold requestsAssignee: Nick Clemens (kidclamp) <nick>
Status: CLOSED FIXED QA Contact: Tomás Cohen Arazi (tcohen) <tomascohen>
Severity: normal    
Priority: P5 - low CC: bwsdonna, gmcharlt, kyle, lucas, rcoert, sbrown, tomascohen, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.03,21.05.14
Circulation function:
Bug Depends on: 15986    
Bug Blocks:    
Attachments: Bug 29704: Add a triggered option to holds_reminder.pl
Bug 29704: Add a triggered option to holds_reminder.pl
Bug 29704: Add a triggered option to holds_reminder.pl

Description Andrew Fuerste-Henry 2021-12-15 19:50:08 UTC
The holds reminder email cron takes a DAYS value and sends reminders to all patrons with holds waiting more than that number of days. Currently, once a hold passes the number of DAYS specified in the cron, the patron gets a reminder on EVERY run of the cron going forward.

We should also provide an option to send reminder emails only for holds that have been waiting EXACTLY that many days.
Comment 1 Nick Clemens (kidclamp) 2021-12-17 15:53:22 UTC
Created attachment 128680 [details] [review]
Bug 29704: Add a triggered option to holds_reminder.pl

This patch adds an option to only trigger notices matching the number of
days waiting specified

You will need to define HOLD_REMINDER notices for the specific branch of the
patron and ensure the patron has hold reminder notices in their messaging preferences

TO test:
1 - Place a hold for a patron and check in to confirm
2 - Set the waiting date back a few days:
    update reserves set waitingdate = DATE_SUB(CURDATE(), INTERVAL 5 DAY);
3 - Run the cron and see that patron would be notified if running for 4 days weaiting
    perl misc/cronjobs/holds/holds_reminder.pl -v --days 4
4 - Apply patch
5 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 4 --triggered
6 - Note patron would not be notified
7 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 5 --triggered
8 - Note patron is notified when days waiting matches exactly
Comment 2 Andrew Fuerste-Henry 2022-01-05 18:45:33 UTC
Created attachment 129042 [details] [review]
Bug 29704: Add a triggered option to holds_reminder.pl

This patch adds an option to only trigger notices matching the number of
days waiting specified

You will need to define HOLD_REMINDER notices for the specific branch of the
patron and ensure the patron has hold reminder notices in their messaging preferences

TO test:
1 - Place a hold for a patron and check in to confirm
2 - Set the waiting date back a few days:
    update reserves set waitingdate = DATE_SUB(CURDATE(), INTERVAL 5 DAY);
3 - Run the cron and see that patron would be notified if running for 4 days weaiting
    perl misc/cronjobs/holds/holds_reminder.pl -v --days 4
4 - Apply patch
5 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 4 --triggered
6 - Note patron would not be notified
7 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 5 --triggered
8 - Note patron is notified when days waiting matches exactly

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Comment 3 Tomás Cohen Arazi (tcohen) 2022-01-06 18:26:41 UTC
Created attachment 129114 [details] [review]
Bug 29704: Add a triggered option to holds_reminder.pl

This patch adds an option to only trigger notices matching the number of
days waiting specified

You will need to define HOLD_REMINDER notices for the specific branch of the
patron and ensure the patron has hold reminder notices in their messaging preferences

TO test:
1 - Place a hold for a patron and check in to confirm
2 - Set the waiting date back a few days:
    update reserves set waitingdate = DATE_SUB(CURDATE(), INTERVAL 5 DAY);
3 - Run the cron and see that patron would be notified if running for 4 days weaiting
    perl misc/cronjobs/holds/holds_reminder.pl -v --days 4
4 - Apply patch
5 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 4 --triggered
6 - Note patron would not be notified
7 - perl misc/cronjobs/holds/holds_reminder.pl -v --days 5 --triggered
8 - Note patron is notified when days waiting matches exactly

Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 4 Fridolin Somers 2022-01-19 07:21:06 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑
Comment 5 Lucas Gass (lukeg) 2022-01-19 17:25:32 UTC
Any chance this will get a backport for 21.11 and 21.05?
Comment 6 Kyle M Hall (khall) 2022-02-04 19:20:46 UTC
Pushed to 21.11.x for 21.11.03
Comment 7 Andrew Fuerste-Henry 2022-02-11 17:28:25 UTC
Missing dependency, not backported to 21.05
Comment 8 Nick Clemens (kidclamp) 2022-04-22 11:18:09 UTC
(In reply to Andrew Fuerste-Henry from comment #7)
> Missing dependency, not backported to 21.05

Does not rely on 28153 - only 15986 - please reconsider?
Comment 9 Andrew Fuerste-Henry 2022-04-22 13:43:06 UTC
Pushed to 21.05.x for 21.05.14
Comment 10 Victor Grousset/tuxayo 2022-04-22 16:21:16 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.