Bug 36106

Summary: Port default PREDUE and DUE notices to Template Toolkit
Product: Koha Reporter: Emily Lamancusa (emlam) <emily.lamancusa>
Component: NoticesAssignee: Emily Lamancusa (emlam) <emily.lamancusa>
Status: Needs documenting --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: fridolin.somers, lucas
Version: MainKeywords: Academy, roadmap_24_05
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: String patch
Documentation contact: Documentation submission:
Text to go in the release notes:
The default notice templates for advance notice and item due notifications now use modern Template Toolkit rather than the old custom syntax. This will only affect new installations, unless the library chooses to reset their notices to the default.
Version(s) released in:
24.05.00
Circulation function:
Bug Depends on:    
Bug Blocks: 15278    
Attachments: Bug 36106: Adjust DUE and PREDUE notices to use TT
Bug 36106: Adjust DUE and PREDUE notices to use TT

Description Emily Lamancusa (emlam) 2024-02-15 18:17:01 UTC
The following notices need to be updated to use Template Toolkit syntax:
DUE (email)
DUE (sms)
PREDUE (email)
PREDUE (sms)

These ones should be fairly straightforward. All four notices have nearly identical content, so it makes sense to group them together.
Comment 1 Lucas Gass (lukeg) 2024-02-15 18:37:57 UTC
I am assuming will be retain the ability to use <<item.content>> ?
Comment 2 Emily Lamancusa (emlam) 2024-02-15 19:04:55 UTC
Yup, this is just about updating the default notice text (and making sure the notices support the item content via TT if they don't already), not deprecating <<items.content>> on the back end.
Comment 3 Lucas Gass (lukeg) 2024-02-15 20:46:02 UTC
(In reply to Emily Lamancusa from comment #2)
> Yup, this is just about updating the default notice text (and making sure
> the notices support the item content via TT if they don't already), not
> deprecating <<items.content>> on the back end.

Great! Thanks, Emily!
Comment 4 Emily Lamancusa (emlam) 2024-04-25 20:55:48 UTC
Created attachment 165591 [details] [review]
Bug 36106: Adjust DUE and PREDUE notices to use TT

To test:
1. Apply patch
2. reset_all (or start your testing environment in the first place)
3. Enable SMS Notices
    a) Find the system preference SMSSendDriver
    b) Enter "Email" as the value for SMSSendDriver and save
4. Go to a patron account, and set the following messaging preferences:
    Item due:
        - Check SMS
        - Check Email
        - Leave Digests only unchecked
    Advance notice
        - Select 1 day in advance
        - Check SMS
        - Check Email
        - Leave Digests only unchecked
5. Go to the checkout tab for that patron
6. Set a custom due date for today and check out an item
7. Set a custom due date for tomorrow and check out another item
8. Run the cron job to generate notices:
   misc/cronjobs/advance_notices.pl -v -c
9. Open the Notices tab on that patron's account
--> The patron should have four notices:
    Item due reminder (one for SMS and one for email)
    Advance notice of item due (one for SMS and one for email)
10. Open each notice and confirm that all information is correct
Comment 5 Martin Renvoize (ashimema) 2024-05-08 13:19:48 UTC
Created attachment 166415 [details] [review]
Bug 36106: Adjust DUE and PREDUE notices to use TT

To test:
1. Apply patch
2. reset_all (or start your testing environment in the first place)
3. Enable SMS Notices
    a) Find the system preference SMSSendDriver
    b) Enter "Email" as the value for SMSSendDriver and save
4. Go to a patron account, and set the following messaging preferences:
    Item due:
        - Check SMS
        - Check Email
        - Leave Digests only unchecked
    Advance notice
        - Select 1 day in advance
        - Check SMS
        - Check Email
        - Leave Digests only unchecked
5. Go to the checkout tab for that patron
6. Set a custom due date for today and check out an item
7. Set a custom due date for tomorrow and check out another item
8. Run the cron job to generate notices:
   misc/cronjobs/advance_notices.pl -v -c
9. Open the Notices tab on that patron's account
--> The patron should have four notices:
    Item due reminder (one for SMS and one for email)
    Advance notice of item due (one for SMS and one for email)
10. Open each notice and confirm that all information is correct

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Martin Renvoize (ashimema) 2024-05-08 13:20:23 UTC
Great work, thanks Emily.

Passing QA
Comment 7 Katrin Fischer 2024-05-10 13:20:03 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 8 Fridolin Somers 2024-05-29 08:47:20 UTC
Not backported to 23.11.x