Koha How-To
Cron Jobs: Overdue Notices
Overdue Notice Status & Triggers
The Overdue Notice cron uses the Overdue Notice Status and Triggers set up (found in the Tools Module) to determine which patron categories, how many days overdue and which notice to prepare to be sent to the patron. The cron job also allows some preferences to be set separately from this tool if necessary. Some of the options found below will be useful if the Overdue Notice Status and Trigger tool is not used, such as the patron category and number of days.
Overdue Notice Cron using Triggers
By default, the Overdue Notice cron will be run without any conditions except for ‘-t,’ which tells the cron to use the triggers set up in tools. That will look like this:
$KOHA_CRON_PATH/overdue_notices.pl -t
This will process all libraries individually looking at the Overdue Notice Status and Triggers. Notices are prepared for all the patrons with overdue items for whom have email addresses. If a patron does not have an email address, the overdue notices will be sent in a single attachment to the library’s administrator email or to the address in the KohaAdminEmailAddress system preference.
In the case where patrons don’t have emails and Koha is emailing the overdue notices to the library, the library can choose what type of file they receive from the cron. The default is HTML, however, this attachment of notices can also be sent in a .txt or .csv format.
As with most areas in Koha, this can be changed and customized per the needs of the library. The cron as explained above is just one method and like most of Koha’s crons, there are different options that can be applied.
Other Overdue Notice Cron Options
These options include:
- Choosing a specific branchcode or multiple branchcodes to process the overdue, which means a library can leave out other branches if necessary. For example to run the cron for only the East and West branches (branch codes “E” and “W”, your cron file would say:
$KOHA_CRON_PATH/overdue_notices.pl -t -library E -library W
- Choosing to prepare or not prepare overdues for a specific patron category. This cron can be run outside of the Overdue Notice Status and Triggers and therefore this option would be used in that context. For example, to run the cron and exclude a specific category code such as ILL, your cron file would say:
$KOHA_CRON_PATH/overdue_notices.pl -t -borcatout ILL
- Choosing what item information is included in the overdue notice. A library can choose to use the standard <<items.content>> in the notice, however, may want to alter what is included in the statement. By default, <<items.content>> includes due date, barcode, title, author. For example, if your library wanted to alter the <<items.content>> to only include duedate and title, your cron file would say:
$KOHA_CRON_PATH/overdue_notices.pl -t -itemscontent duedate, title
- Koha can prepare the overdue notices by what is triggered by the Overdue Notice Status and Triggers OR it can prepare overdue notices looking for items with a max number of days in the statement instead. If a library wanted to run overdue notices not using the Triggers set up but instead wanted to run and capture all overdues for the last 90 days. This cron file would say:
$KOHA_CRON_PATH/overdue_notice.pl -max 90
- Choosing which email to use in the borrowers schema. Libraries can have stored multiple email addresses for a patron, and this portion of the cron can tell Koha which email to use.
$KOHA_CRON_PATH/overdue_notice.pl -email emailpro
- Crons in Koha can be run without really sending the emails; there are two options in the cron that this can happen. The cron can be run in test mode (adding - test to the cron line), which will make no changes to the database and/ or it can be run without actually sending the emails. Running it without sending emails (but still applying restrictions if specified in your triggers):
$KOHA_CRON_PATH/Overdue_notices.pl -n
More Cron Job Blog Posts
Monday Minutes : Sharing Usage through Hea
Monday Minutes: Emailing Customized Patron Notices
How Would You Like Your Report?
More Cron Job Resources
Read more by Kelly McElligott