Bug 15543 - Use another notice in membership_expiry.pl
Summary: Use another notice in membership_expiry.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on: 14834
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-11 09:31 UTC by Marcel de Rooy
Modified: 2016-12-05 21:27 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15543: Use another notice in membership_expiry.pl (4.79 KB, patch)
2016-01-18 11:12 UTC, Marcel de Rooy
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15543: Use another notice in membership_expiry.pl (5.00 KB, patch)
2016-04-20 13:45 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 15543: Use another notice in membership_expiry.pl (5.04 KB, patch)
2016-04-28 12:59 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2016-01-11 09:31:50 UTC

    
Comment 1 Marcel de Rooy 2016-01-18 11:12:53 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2016-04-20 13:45:32 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall 2016-04-28 12:59:20 UTC
Created attachment 50914 [details] [review]
Bug 15543: Use another notice in membership_expiry.pl

This patch adds a letter parameter to the cron job membership_expiry.
It is used to substitute the default notice by another one.
This could be handy if you e.g. send a reminder after the first notice.
In any case, it allows for more flexibility.

Apart from this new parameter, this patch removes the sub parse_letter from
the code. The call to GetPreparedLetter is moved to the for loop and the
call to getletter is removed (no longer needed). If there is no letter
found, the Letter module already warns you. So we just exit the loop.

Test plan:
[1] Run membership_expiry.pl -c -n -v -let NOT_EXIST
    Check if you see a warning (coming from Letters.pm)
[2] Check if you have some soon expiring patrons or add before/after
    parameter to include some.
    Run membership_expiry.pl -c -n -v [-before ?] [-after ?]
[3] Create a new notice MEMBERSHIP2. Copy the text from the original notice
    and make some adjustments.
[4] Run membership_expiry.pl -c -v -let MEMBERSHIP2 [-before ?] [-after ?].
    Be aware that this call generates email messages.
    Verify that the email contained the adjusted text.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

On top of Bug 14834
Work as described, tested using '-n' to see messages on terminal, e.g.
membership_expiry.pl -v -n -c -before 3 -branch BC -after 2 --letter MEMEXP2
No errors

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 4 Kyle M Hall 2016-04-29 16:59:36 UTC
Pushed to master for Koha 16.05. Thanks Marcel!