Bug 29704 - Holds reminder emails should allow configuration for a specific number of days
Summary: Holds reminder emails should allow configuration for a specific number of days
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: master
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Tomás Cohen Arazi
URL:
Keywords:
Depends on: 15986
Blocks:
  Show dependency treegraph
 
Reported: 2021-12-15 19:50 UTC by Andrew Fuerste-Henry
Modified: 2022-04-25 16:06 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
Version(s) released in:
22.05.00,21.11.03,21.05.14


Attachments
Bug 29704: Add a triggered option to holds_reminder.pl (3.56 KB, patch)
2021-12-17 15:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 29704: Add a triggered option to holds_reminder.pl (3.62 KB, patch)
2022-01-05 18:45 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 29704: Add a triggered option to holds_reminder.pl (3.68 KB, patch)
2022-01-06 18:26 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 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 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 🦄
Comment 5 Lucas Gass 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 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 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.