<<

NAME

membership_expiry.pl - cron script to put membership expiry reminders into the message queue

SYNOPSIS

./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]

DESCRIPTION

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.

OPTIONS

--help

Print a brief help message and exits.

--man

Prints the manual page and exits.

-v

Verbose. Without this flag set, only fatal errors are reported.

-n

Do not send any email. Membership expire notices that would have been sent to the patrons are printed to standard out.

-c

Confirm flag: Add this option. The script will only print a usage statement otherwise.

-branch

Optional branchcode to restrict the cronjob to that branch.

-before

Optional parameter to extend the selection with a number of days BEFORE the date set by the preference.

-after

Optional parameter to extend the selection with a number of days AFTER the date set by the preference.

-where

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.

-letter

Optional parameter to use another expiry notice than the default: MEMBERSHIP_EXPIRY

-letter_renew

Optional parameter to use another renewal notice than the default: MEMBERSHIP_RENEWED

-active

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.

-inactive

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.

-renew

Optional parameter to automatically renew patrons instead of sending them an expiry notice. They will be informed by a patron renewal notice.

CONFIGURATION

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:

<<borrowers.*>>

any field from the borrowers table

<<branches.*>>

any field from the branches table

<<