Hello :) I purpose to add an email notification to patron when a booking is cancelled.
Created attachment 167010 [details] [review] Bug 36915: Send email notification when a booking is cancelled When a booking is cancelled, patron received an email based on specific letter. Test plan: 1) Create a letter with code "BOOKING_CANCELLATION" on "Notices and slips" tool. 2) Add booking or go on item already booked in advance. 3) Cancel it 4) Verify in message_queue table directly or go on patron page and click on "Notices" tab section. Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS)
Shouldn't this be in $booking->delete instead?
Created attachment 167013 [details] [review] Bug 36915: Send email notification when a booking is cancelled When a booking is cancelled, patron received an email based on specific letter. Test plan: 1) Create a letter with code "BOOKING_CANCELLATION" on "Notices and slips" tool. 2) Add booking or go on item already booked in advance. 3) Cancel it 4) Verify in message_queue table directly or go on patron page and click on "Notices" tab section. Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS)
(In reply to Jonathan Druart from comment #2) > Shouldn't this be in $booking->delete instead? Thanks for your feedback, you're right.. I was wrong :)
And please provide tests ;)
I like this, and it was indeed on my enhancements list ;) Couple of comments, however.. 1) Could we pass the bookings object into GetPreparedLetter instead of passing various individual pieces. (Bug 19966 adds this functionality to GetPreperaredLetter, you'd want to pass the object and then call delete at the end of the method after GetPreparredLetter has returned) 2) Could we add a sample notice template too.
Created attachment 168149 [details] [review] Bug 36915: Send email notification when a booking is cancelled When a booking is cancelled, patron received an email based on specific letter. Test plan: 1) Create a letter with code "BOOKING_CANCELLATION" on "Notices and slips" tool. 2) Add booking or go on item already booked in advance. 3) Cancel it 4) Verify in message_queue table directly or go on patron page and click on "Notices" tab section. Sponsored by: Association de Gestion des Œuvres Sociales d'Inria (AGOS) Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Created attachment 168150 [details] [review] Bug 36915: (follow-up) Pass object to GetPreparedLetter This patch updates the logic to pass the object to be deleted through to GetPreparedLetter. This way, as we add fields and accessors to the object in the future, they will automatically become available to the notices.
I added the suggested follow-up to utilise the 'objects' option in GetPreparedLetter. Still needs unit tests.. I'll try to take a look at adding those when I can. I'm also working on a default notice template to ship. I do wonder if we really want to tie this to 'delete'.. I'd be tempted to introduce a 'cancel' method to be more explicit. Then if we later introduce database cleanup or other workflows that include deletions we can call the standard delete method without having to work around the cancellation message handling.
Created attachment 168155 [details] [review] Bug 36915: (follow-up) Basic sample notice