membership_expiry.pl - cron script to put membership expiry reminders into the message queue
./membership_expiry.pl -c [-v] [-n] [-branch CODE] [-before DAYS] [-after DAYS] [-where COND] [-renew] [-letter X] [-letter-renew Y] [-active|-inactive]
or, in crontab:
0 1 * * * membership_expiry.pl -c [other options you need as mentioned above]
This script sends membership expiry reminder notices to patrons, by email and sms. It queues them in the message queue, which is processed by the process_message_queue.pl cronjob.
Print a brief help message and exits.
Prints the manual page and exits.
Verbose. Without this flag set, only fatal errors are reported.
Do not send any email. Membership expire notices that would have been sent to the patrons are printed to standard out.
Confirm flag: Add this option. The script will only print a usage statement otherwise.
Optional branchcode to restrict the cronjob to that branch.
Optional parameter to extend the selection with a number of days BEFORE the date set by the preference.
Optional parameter to extend the selection with a number of days AFTER the date set by the preference.
Use this option to specify a condition built with columns from the borrowers table
e.g. --where 'lastseen IS NOT NULL' will only notify patrons who have been seen.
Optional parameter to use another expiry notice than the default: MEMBERSHIP_EXPIRY
Optional parameter to use another renewal notice than the default: MEMBERSHIP_RENEWED
Optional parameter to include active patrons only (active within passed number of months). This parameter needs the preference TrackLastPatronActivityTriggers.
IMPORTANT: You should be using those triggers already for the period that you consider a user to be (in)active.
Optional parameter to include inactive patrons only (inactive within passed number of months). This allows you to e.g. send expiry warnings only to inactive patrons. This parameter needs the preference TrackLastPatronActivityTriggers.
IMPORTANT: You should be using those triggers already for the period that you consider a user to be (in)active.
Optional parameter to automatically renew patrons instead of sending them an expiry notice. They will be informed by a patron renewal notice.
The content of the messages is configured in Tools -> Notices and slips. Use the MEMBERSHIP_EXPIRY notice or supply another via the parameters.
Typically, messages are prepared for each patron when the memberships are going to expire.
These emails are staged in the outgoing message queue, as are messages produced by other features of Koha. This message queue must be processed regularly by the misc/cronjobs/process_message_queue.pl program.
In the event that the -n
flag is passed to this program,
no emails are sent.
Instead,
messages are sent on standard output from this program.
Notices can contain variables enclosed in double angle brackets like <<this>>. Those variables will be replaced with values specific to the soon expiring members. Available variables are:
any field from the borrowers table
any field from the branches table