Bug 32216 - Send MEMBERSHIP_EXPIRY notice as print
Summary: Send MEMBERSHIP_EXPIRY notice as print
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Jake Deery
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: release-notes-needed
Depends on:
Blocks:
 
Reported: 2022-11-15 21:54 UTC by Lucas Gass (lukeg)
Modified: 2025-02-27 16:33 UTC (History)
4 users (show)

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


Attachments
Bug 32216: Add print notices to membership_expiry.pl (9.63 KB, patch)
2024-08-28 07:54 UTC, Jake Deery
Details | Diff | Splinter Review
Bug 32216: Add print notices to membership_expiry.pl (9.68 KB, patch)
2024-11-25 14:47 UTC, Andrew Fuerste-Henry
Details | Diff | Splinter Review
Bug 32216: Add print notices to membership_expiry.pl (9.75 KB, patch)
2025-01-17 15:55 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 32216: Add print notices to membership_expiry.pl (9.34 KB, patch)
2025-02-11 15:41 UTC, Jake Deery
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2022-11-15 21:54:29 UTC
This is bug 23773 but for print versions of MEMBERSHIP_EXPIRY
Comment 1 Jake Deery 2024-08-28 07:54:33 UTC
Created attachment 170799 [details] [review]
Bug 32216: Add print notices to membership_expiry.pl

This patch adds print notice functionality to the membership_expiry.pl script,
by adding both conditional and and forced modes. When passing only --confirm,
the script will check the patron's record for an email address. If one is
found, an email notice is generated. If one is not, a print notice is used
instead. By adding a -p flag, print notices will be generated, even if an
email address is present.

To test:
a)  set the MembershipExpiryDaysNotice syspref to 7 days
b)  choose or set up half a dozen patrons with expiry dates
    1)  take heed: these expiry dates will need to be T+7 days
c)  add fake email addresses to two of the patrons
    1)  take heed: the other patrons should have no primary or secondary
        email
d)  set up the MEMBERSHIP_EXPIRY notice
    a)  set content & subject in the email notice to contain the word
        email
    b)  set content & subject in the print notice to contain the word
        print
e)  run ./misc/cronjobs/membership_expiry.pl -n -c
    1)  notice how the printed notices contain the word email
f)  run ./misc/cronjobs/membership_expiry.pl -c
g)  check the notices for the patrons from step b
    1)  notice how only email notices are generated
h)  APPLY PATCH
i)  repeat step e
    1)  notice how a mix of email and print notices are now generated
j)  run ./misc/cronjobs/membership_expiry.pl -n -p -c
    1)  notice how the output is the same as in step i - this is by
        design
k)  repeat steps f-g
    1)  notice how some patrons will only get an email notice, whilst
        others will only get a print notice
    2)  this should occur based on which patrons do, or do not have a
        valid primary or secondary email
l)  run ./misc/cronjobs/membership_expiry.pl -p -c
m)  repeat step g
    1)  notice that all patrons now get a print notice, whilst some get
        both a print notice, and an email notice. Again, this should
        occur based on whether the patron has a valid primary or
        secondary email
n)  SIGN OFF
Comment 2 Jake Deery 2024-10-07 07:45:22 UTC
Forgot to update the status on this one. Sorry, folks!

Jake.
Comment 3 Andrew Fuerste-Henry 2024-11-25 14:47:55 UTC
Created attachment 174975 [details] [review]
Bug 32216: Add print notices to membership_expiry.pl

This patch adds print notice functionality to the membership_expiry.pl script,
by adding both conditional and and forced modes. When passing only --confirm,
the script will check the patron's record for an email address. If one is
found, an email notice is generated. If one is not, a print notice is used
instead. By adding a -p flag, print notices will be generated, even if an
email address is present.

To test:
a)  set the MembershipExpiryDaysNotice syspref to 7 days
b)  choose or set up half a dozen patrons with expiry dates
    1)  take heed: these expiry dates will need to be T+7 days
c)  add fake email addresses to two of the patrons
    1)  take heed: the other patrons should have no primary or secondary
        email
d)  set up the MEMBERSHIP_EXPIRY notice
    a)  set content & subject in the email notice to contain the word
        email
    b)  set content & subject in the print notice to contain the word
        print
e)  run ./misc/cronjobs/membership_expiry.pl -n -c
    1)  notice how the printed notices contain the word email
f)  run ./misc/cronjobs/membership_expiry.pl -c
g)  check the notices for the patrons from step b
    1)  notice how only email notices are generated
h)  APPLY PATCH
i)  repeat step e
    1)  notice how a mix of email and print notices are now generated
j)  run ./misc/cronjobs/membership_expiry.pl -n -p -c
    1)  notice how the output is the same as in step i - this is by
        design
k)  repeat steps f-g
    1)  notice how some patrons will only get an email notice, whilst
        others will only get a print notice
    2)  this should occur based on which patrons do, or do not have a
        valid primary or secondary email
l)  run ./misc/cronjobs/membership_expiry.pl -p -c
m)  repeat step g
    1)  notice that all patrons now get a print notice, whilst some get
        both a print notice, and an email notice. Again, this should
        occur based on whether the patron has a valid primary or
        secondary email
n)  SIGN OFF

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Comment 4 Martin Renvoize (ashimema) 2025-01-17 15:55:44 UTC
Created attachment 176745 [details] [review]
Bug 32216: Add print notices to membership_expiry.pl

This patch adds print notice functionality to the membership_expiry.pl script,
by adding both conditional and and forced modes. When passing only --confirm,
the script will check the patron's record for an email address. If one is
found, an email notice is generated. If one is not, a print notice is used
instead. By adding a -p flag, print notices will be generated, even if an
email address is present.

To test:
a)  set the MembershipExpiryDaysNotice syspref to 7 days
b)  choose or set up half a dozen patrons with expiry dates
    1)  take heed: these expiry dates will need to be T+7 days
c)  add fake email addresses to two of the patrons
    1)  take heed: the other patrons should have no primary or secondary
        email
d)  set up the MEMBERSHIP_EXPIRY notice
    a)  set content & subject in the email notice to contain the word
        email
    b)  set content & subject in the print notice to contain the word
        print
e)  run ./misc/cronjobs/membership_expiry.pl -n -c
    1)  notice how the printed notices contain the word email
f)  run ./misc/cronjobs/membership_expiry.pl -c
g)  check the notices for the patrons from step b
    1)  notice how only email notices are generated
h)  APPLY PATCH
i)  repeat step e
    1)  notice how a mix of email and print notices are now generated
j)  run ./misc/cronjobs/membership_expiry.pl -n -p -c
    1)  notice how the output is the same as in step i - this is by
        design
k)  repeat steps f-g
    1)  notice how some patrons will only get an email notice, whilst
        others will only get a print notice
    2)  this should occur based on which patrons do, or do not have a
        valid primary or secondary email
l)  run ./misc/cronjobs/membership_expiry.pl -p -c
m)  repeat step g
    1)  notice that all patrons now get a print notice, whilst some get
        both a print notice, and an email notice. Again, this should
        occur based on whether the patron has a valid primary or
        secondary email
n)  SIGN OFF

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Jake Deery 2025-02-11 15:41:48 UTC
Created attachment 177740 [details] [review]
Bug 32216: Add print notices to membership_expiry.pl

This patch adds print notice functionality to the membership_expiry.pl script,
by adding both conditional and and forced modes. When passing only --confirm,
the script will check the patron's record for an email address. If one is
found, an email notice is generated. If one is not, a print notice is used
instead. By adding a -p flag, print notices will be generated, even if an
email address is present.

To test:
a)  set the MembershipExpiryDaysNotice syspref to 7 days
b)  choose or set up half a dozen patrons with expiry dates
    1)  take heed: these expiry dates will need to be T+7 days
c)  add fake email addresses to two of the patrons
    1)  take heed: the other patrons should have no primary or secondary
        email
d)  set up the MEMBERSHIP_EXPIRY notice
    a)  set content & subject in the email notice to contain the word
        email
    b)  set content & subject in the print notice to contain the word
        print
e)  run ./misc/cronjobs/membership_expiry.pl -n -c
    1)  notice how the printed notices contain the word email
f)  run ./misc/cronjobs/membership_expiry.pl -c
g)  check the notices for the patrons from step b
    1)  notice how only email notices are generated
h)  APPLY PATCH
i)  repeat step e
    1)  notice how a mix of email and print notices are now generated
j)  run ./misc/cronjobs/membership_expiry.pl -n -p -c
    1)  notice how the output is the same as in step i - this is by
        design
k)  repeat steps f-g
    1)  notice how some patrons will only get an email notice, whilst
        others will only get a print notice
    2)  this should occur based on which patrons do, or do not have a
        valid primary or secondary email
l)  run ./misc/cronjobs/membership_expiry.pl -p -c
m)  repeat step g
    1)  notice that all patrons now get a print notice, whilst some get
        both a print notice, and an email notice. Again, this should
        occur based on whether the patron has a valid primary or
        secondary email
n)  SIGN OFF

Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 6 Jake Deery 2025-02-11 15:42:08 UTC
Rebased on main
Comment 7 Katrin Fischer 2025-02-27 15:51:30 UTC
Hi Jake, this does a bit more than the bug description advertises. Can you please write a little summary for release notes? (new option for the script etc.)

At some point we need to clean up all the fallback behavior for print notices and the like. There should be a way for libraries to determine what should create a print notice if no email... but that's out of scope here.
Comment 8 Katrin Fischer 2025-02-27 16:33:12 UTC
Pushed for 25.05!

Well done everyone, thank you!