Bug 17617 - Add the ability of sending a confirmation e-mail to patron when hold is placed
Summary: Add the ability of sending a confirmation e-mail to patron when hold is placed
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement with 1 vote (vote)
Assignee: Aleisha Amohia
QA Contact: Marcel de Rooy
URL:
Keywords:
: 35140 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-11 17:43 UTC by Sally
Modified: 2023-11-30 16:05 UTC (History)
9 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
When the new system preference `EmailPatronWhenHoldIsPlaced` is activated, a notice will be sent to the patron to confirm their hold has been placed. The notice template used is HOLDPLACED_PATRON.
Version(s) released in:
23.11.00


Attachments
Bug 17617: EmailPatronWhenHoldIsPlaced system preference (3.54 KB, patch)
2023-10-26 21:45 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 17617: Add HOLDPLACED_PATRON notice (2.86 KB, patch)
2023-10-26 21:46 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 17617: Unit tests (3.75 KB, patch)
2023-10-26 21:46 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 17617: Confirmation email to patron when hold is placed (2.89 KB, patch)
2023-10-26 21:46 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 17617: EmailPatronWhenHoldIsPlaced system preference (3.58 KB, patch)
2023-10-27 18:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 17617: Add HOLDPLACED_PATRON notice (2.91 KB, patch)
2023-10-27 18:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 17617: Unit tests (3.80 KB, patch)
2023-10-27 18:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 17617: Confirmation email to patron when hold is placed (2.94 KB, patch)
2023-10-27 18:13 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 17617: EmailPatronWhenHoldIsPlaced system preference (3.67 KB, patch)
2023-11-03 08:45 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 17617: Add HOLDPLACED_PATRON notice (3.00 KB, patch)
2023-11-03 08:45 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 17617: Unit tests (3.89 KB, patch)
2023-11-03 08:45 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 17617: Confirmation email to patron when hold is placed (3.04 KB, patch)
2023-11-03 08:45 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Sally 2016-11-11 17:43:09 UTC
If an item is purchased from an online shop, the patron will receive a confirmation e-mail of their order. 

We would like to see something similar in Koha when a hold is placed.  

We think this would be useful to confirm some key points, for example:

- confirm the hold has been added to the system
- confirm the title details of the requested item
- confirm the collection library
- confirm the fee which will be charged for fulfilling the hold
- confirm the fee which will be charged if the hold is not collected
- explain how to cancel the hold if it's no longer required
- explain how to make changes to the hold if any details (e.g. change collection library from AAA to BBB) alter
- explain how the patron will be notified when the item is ready for collection

There is already a system preference: emailLibrarianWhenHoldIsPlaced - which enables Koha to e-mail the library staff whenever a patron places a hold.

Could the code behind this be adapted to e-mail patrons instead, perhaps?
Comment 1 Sally 2023-10-26 12:37:58 UTC
*** Bug 35140 has been marked as a duplicate of this bug. ***
Comment 2 Aleisha Amohia 2023-10-26 21:45:58 UTC
Created attachment 157961 [details] [review]
Bug 17617: EmailPatronWhenHoldIsPlaced system preference
Comment 3 Aleisha Amohia 2023-10-26 21:46:01 UTC
Created attachment 157962 [details] [review]
Bug 17617: Add HOLDPLACED_PATRON notice

A HOLDPLACED notice exists and is used by the emailLibrarianWhenHoldIsPlaced function, but libraries may want to use different wording when emailing patrons.
Comment 4 Aleisha Amohia 2023-10-26 21:46:04 UTC
Created attachment 157963 [details] [review]
Bug 17617: Unit tests
Comment 5 Aleisha Amohia 2023-10-26 21:46:06 UTC
Created attachment 157964 [details] [review]
Bug 17617: Confirmation email to patron when hold is placed

This enhancement adds a new notice HOLDPLACED_PATRON that will be sent to a patron when a hold is placed for them. It depends on the new system preference EmailPatronWhenHoldIsPlaced to be enabled.

To test:
1) Update database and restart services
2) Go to Koha Administration -> System preferences and search for the new EmailPatronWhenHoldIsPlaced syspref. It should be disabled by default - leave it disabled for now.
3) Search for a record and go to the Holds tab. Place a hold for your patron.
4) Go to your patron's account and go to the Notices tab. Confirm the HOLDPLACED_PATRON notice was NOT queued.
5) Enable the EmailPatronWhenHoldIsPlaced syspref.
6) Repeat steps 3 and 4. Confirm the HOLDPLACED_PATRON notice WAS generated and queued.
7) Confirm tests pass t/db_dependent/Holds.t

Sponsored-by: Fire and Emergency New Zealand
Comment 6 ByWater Sandboxes 2023-10-27 18:13:16 UTC
Created attachment 157995 [details] [review]
Bug 17617: EmailPatronWhenHoldIsPlaced system preference

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Comment 7 ByWater Sandboxes 2023-10-27 18:13:18 UTC
Created attachment 157996 [details] [review]
Bug 17617: Add HOLDPLACED_PATRON notice

A HOLDPLACED notice exists and is used by the emailLibrarianWhenHoldIsPlaced function, but libraries may want to use different wording when emailing patrons.

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Comment 8 ByWater Sandboxes 2023-10-27 18:13:20 UTC
Created attachment 157997 [details] [review]
Bug 17617: Unit tests

Signed-off-by: Kelly <kelly@bywatersolutions.com>
Comment 9 ByWater Sandboxes 2023-10-27 18:13:23 UTC
Created attachment 157998 [details] [review]
Bug 17617: Confirmation email to patron when hold is placed

This enhancement adds a new notice HOLDPLACED_PATRON that will be sent to a patron when a hold is placed for them. It depends on the new system preference EmailPatronWhenHoldIsPlaced to be enabled.

To test:
1) Update database and restart services
2) Go to Koha Administration -> System preferences and search for the new EmailPatronWhenHoldIsPlaced syspref. It should be disabled by default - leave it disabled for now.
3) Search for a record and go to the Holds tab. Place a hold for your patron.
4) Go to your patron's account and go to the Notices tab. Confirm the HOLDPLACED_PATRON notice was NOT queued.
5) Enable the EmailPatronWhenHoldIsPlaced syspref.
6) Repeat steps 3 and 4. Confirm the HOLDPLACED_PATRON notice WAS generated and queued.
7) Confirm tests pass t/db_dependent/Holds.t

Sponsored-by: Fire and Emergency New Zealand
Signed-off-by: Kelly <kelly@bywatersolutions.com>
Comment 10 Sally 2023-10-31 10:55:20 UTC
This is great, Aleisha - appreciate you working on this one.

In addition to the system preference:  

Patrons can control whether they receive a hold collection notice via their messaging preferences.  I wonder if they should also be allowed to opt out of these hold placed notices?

We could open a new bug for it?
Comment 11 Marcel de Rooy 2023-11-03 08:45:17 UTC
Created attachment 158310 [details] [review]
Bug 17617: EmailPatronWhenHoldIsPlaced system preference

Signed-off-by: Kelly <kelly@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Marcel de Rooy 2023-11-03 08:45:20 UTC
Created attachment 158311 [details] [review]
Bug 17617: Add HOLDPLACED_PATRON notice

A HOLDPLACED notice exists and is used by the emailLibrarianWhenHoldIsPlaced function, but libraries may want to use different wording when emailing patrons.

Signed-off-by: Kelly <kelly@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 13 Marcel de Rooy 2023-11-03 08:45:23 UTC
Created attachment 158312 [details] [review]
Bug 17617: Unit tests

Signed-off-by: Kelly <kelly@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 14 Marcel de Rooy 2023-11-03 08:45:26 UTC
Created attachment 158313 [details] [review]
Bug 17617: Confirmation email to patron when hold is placed

This enhancement adds a new notice HOLDPLACED_PATRON that will be sent to a patron when a hold is placed for them. It depends on the new system preference EmailPatronWhenHoldIsPlaced to be enabled.

To test:
1) Update database and restart services
2) Go to Koha Administration -> System preferences and search for the new EmailPatronWhenHoldIsPlaced syspref. It should be disabled by default - leave it disabled for now.
3) Search for a record and go to the Holds tab. Place a hold for your patron.
4) Go to your patron's account and go to the Notices tab. Confirm the HOLDPLACED_PATRON notice was NOT queued.
5) Enable the EmailPatronWhenHoldIsPlaced syspref.
6) Repeat steps 3 and 4. Confirm the HOLDPLACED_PATRON notice WAS generated and queued.
7) Confirm tests pass t/db_dependent/Holds.t

Sponsored-by: Fire and Emergency New Zealand
Signed-off-by: Kelly <kelly@bywatersolutions.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 15 Marcel de Rooy 2023-11-03 08:47:36 UTC
Just noting here that it might be good to test $patron->notice_email_address before enqueuing? Note that if SendQueuedMessages does not find an address, it will set status to failed in queue.
No blocker.
Comment 16 Tomás Cohen Arazi 2023-11-08 14:42:17 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 17 Fridolin Somers 2023-11-11 01:07:09 UTC
Enhancement not pushed to 23.05.x