overdue_notices.pl - prepare messages to be sent to patrons for overdue items
overdue_notices.pl [ -n ][ -library <branchcode> ][ -library <branchcode> ... ] [ -max <number of days> ][ -csv [<filename>] ][ -itemscontent <field list> ] [ -email <email_type> ... ]
Options: -help brief help message -man full documentation -v verbose -n No email will be sent -max <days> maximum days overdue to deal with -library <branchname> only deal with overdues from this library (repeatable : several libraries can be given) -csv <filename> populate CSV file -html <directory> Output html to a file in the given directory -text <directory> Output plain text to a file in the given directory -itemscontent <list of fields> item information in templates -borcat <categorycode> category code that must be included -borcatout <categorycode> category code that must be excluded -t only include triggered overdues -list-all list all overdues -date <yyyy-mm-dd> emulate overdues run for this date -email <email_type> type of email that will be used. Can be 'email', 'emailpro' or 'B_email'. Repeatable.
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. Overdue notices that would have been sent to the patrons or to the admin are printed to standard out. CSV data (if the -csv flag is set) is written to standard out or to any csv filename given.
Items older than max days are assumed to be handled somewhere else, probably the longoverdues.pl script. They are therefore ignored by this program. No notices are sent for them, and they are not added to any CSV files. Defaults to 90 to match longoverdues.pl.
select overdues for one specific library. Use the value in the branches.branchcode table. This option can be repeated in order to select overdues for a group of libraries.
Produces CSV data. if -n (no mail) flag is set, then this CSV data is sent to standard out or to a filename if provided. Otherwise, only overdues that could not be emailed are sent in CSV format to the admin.
Produces html data. If patron does not have an email address or -n (no mail) flag is set, an HTML file is generated in the specified directory. This can be downloaded or further processed by library staff. The file will be called notices-YYYY-MM-DD.html and placed in the directory specified.
Produces plain text data. If patron does not have an email address or -n (no mail) flag is set, a text file is generated in the specified directory. This can be downloaded or further processed by library staff. The file will be called notices-YYYY-MM-DD.txt and placed in the directory specified.
comma separated list of fields that get substituted into templates in places of the <<items.content>> placeholder. This defaults to due date,title,barcode,author
Other possible values come from fields in the biblios, items and issues tables.
Repeatable field, that permits to select only some patron categories.
Repeatable field, that permits to exclude some patron categories.
This option causes a notice to be generated if and only if an item is overdue by the number of days defined in a notice trigger.
By default, a notice is sent each time the script runs, which is suitable for less frequent run cron script, but requires syncing notice triggers with the cron schedule to ensure proper behavior. Add the --triggered option for daily cron, at the risk of no notice being generated if the cron fails to run on time.
Default items.content lists only those items that fall in the range of the currently processing notice. Choose list-all to include all overdue items in the list (limited by -max setting).
use it in order to send overdues on a specific date and not Now. Format: YYYY-MM-DD.
Allows to specify which type of email will be used. Can be email, emailpro or B_email. Repeatable.
This script is designed to alert patrons and administrators of overdue items.
This script pays attention to the overdue notice configuration performed in the "Overdue notice/status triggers" section of the "Tools" area of the staff interface to Koha. There, you can choose which letter templates are sent out after a configurable number of days to patrons of each library. More information about the use of this section of Koha is available in the Koha manual.
The templates used to craft the emails are defined in the "Tools: Notices" section of the staff interface to Koha.
Typically, messages are prepared for each patron with overdue items. Messages for whom there is no email address on file are collected and sent as attachments in a single email to each library administrator, or if that is not set, then to the email address in the KohaAdminEmailAddress
system preference.
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. They may be redirected to a file if desired.
Templates can contain variables enclosed in double angle brackets like <<this>>. Those variables will be replaced with values specific to the overdue items or relevant patron. Available variables are:
the name of the library
one line for each item, each line containing a tab separated list of title, author, barcode, issuedate
any field from the borrowers table
any field from the branches table
The -csv
command line option lets you specify a file to which overdues data should be output in CSV format.
With the -n
flag set, data about all overdues is written to the file. Without that flag, only information about overdues that were unable to be sent directly to the patrons will be written. In other words, this CSV file replaces the data that is typically sent to the administrator email address.
overdue_notices.pl
- In this most basic usage, with no command line arguments, all libraries are processed individually, and notices are prepared for all patrons with overdue items for whom we have email addresses. Messages for those patrons for whom we have no email address are sent in a single attachment to the library administrator's email address, or to the address in the KohaAdminEmailAddress system preference.
overdue_notices.pl -n -csv /tmp/overdues.csv
- sends no email and populates /tmp/overdues.csv with information about all overdue items.
overdue_notices.pl -library MAIN max 14
- prepare notices of overdues in the last 2 weeks for the MAIN library.
The misc/cronjobs/advance_notices.pl program allows you to send messages to patrons in advance of their items becoming due, or to alert them of items that have just become due.
These methods are internal to the operation of overdue_notices.pl.
returns a string of text appropriate for printing in the event that an overdue notice will not be sent to the patron's email address. Depending on the desired output format, this may be a CSV string, or a human-readable representation of the notice.
required parameters: letter borrowernumber
optional parameters: outputformat