Version 1 (modified by Dan Scott, 14 years ago) (diff)


Generating email notices

Note: the following method is the legacy way of generating email notices for overdues and reminders. A new method based on the action/trigger/event mechanism launched in Evergreen 1.6 relying on passive scripts and supports wonderful things like patron's locale preferences, etc. However, the legacy method is what we have working today, so let's roll with it.

Out of the box, Evergreen provides templates for a reminder notice the day before an item is due, and an overdue notice that is generated 7 days after the item was due.

# We run the script out of the source directory due to a dependency on
# Eventually we should just copy all the files into the normal bin directory
cd /home/lauadmin/Evergreen-trunk/Open-ILS/src/support-scripts/
# Dump the help for the script
perl --help

Evergreen Circulation Notice Generator

    ---osrf_config <config_file>

        If set, generate email notices

    --use-email-outfile <file>
        Instead of sending emails, append each email (complete with headers) to this file

    --use-email-recipient <>
        Send all email notices to this user instead of the patron.  This updates the
        email address on the user object attached to the circulations, so no
        change to the email templates is required.

        If set, notices which have a notify_interval of >= 1 day will be processed.

        Collect all non-emailed notices into a global set and generate templates based on that set.

        If an attempt was made to send an email notice but it failed, the notice is appended
        to the global notice file set.  This will only have any bearing if --generate-global-templates
        is enabled.

    --days-back <days_back_comma_separted>
        This is used to set the effective run date of the script.
        This is useful if you don't want to generate notices on certain days.  For example, if you don't
        generate notices on the weekend, you would run this script on weekdays and set --days-back to
        0,1,2 when it's run on Monday to capture any notices from Saturday and Sunday.

    --notice-types <overdue,predue,...>
        Comma-separated list of notice types to generate for this run of the script

        Print this help message
# So, to dump the output of both reminders and overdues into a file for review for the last 7 days:
perl --use-email-outfile ~/fakeemail.lst --notice-type overdue,predue --days-back 0,1,2,3,4,5,6,7