[Evergreen-general] Setting up a trigger for overdue items notification

Terran McCanna tmccanna at georgialibraries.org
Tue May 3 15:23:56 EDT 2022


My first thought was perhaps the "Daily" granularity isn't set up in your
cron jobs properly.

Also, you may want to check the Trigger Event Environment (by clicking on
the action trigger title rather than on the row) to make sure it has all
the field paths you need.

This is how we have our 10-day notice set up:

*Trigger Event Environment:*
billable_transaction.summary
circ_lib
circ_lib.billing_address
target_copy.call_number
usr
usr.card
usr.home_ou
usr.home_ou.billing_address
usr.home_ou.hours_of_operation
usr.home_ou.mailing_address
usr.home_ou.parent_ou

*Settings:*
Owning Library: PINES
Name: 10 Day Overdue Email Notification
Hook: checkout.due
Enabled: (checked)
Processing Delay: 10 days
Processing Delay Content Field: due_date
Processing Group Context Field: usr
Reactor: SendEmail
Validator: CircIsOverdue
Context Bib Path: target_copy.call_number.record
Context Item Path: target_copy
Context Library Path: circ_lib
Context User Path: usr
Granularity: overdue-notices
Max Event Validity Delay: 11 days
Retention Interval: 6 mons

*Template: *
[%- USE date -%]
[%- user = target.0.usr -%]
[%- homelib = user.home_ou -%]
To: [%- params.recipient_email || user.email %]
From: [%- helpers.get_org_setting(homelib.id, 'org.bounced_emails') ||
homelib.email || params.sender_email || default_sender %]
Reply-To: [%- helpers.get_org_setting(homelib.id, 'org.bounced_emails') ||
homelib.email || params.sender_email || default_sender %]
Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %]
Subject: [PINES] Overdue Library Materials

Attention:   [% user.first_given_name %] [% user.family_name %]
Card Number: [% user.card.barcode %]

Our records indicate the following items are 10 days or more overdue.

[% FOR circ IN target %]
     [%- copy_details = helpers.get_copy_bib_basics(circ.target_copy.id) -%]
     Title:    [% copy_details.title FILTER ucfirst %]
     Author:   [% copy_details.author FILTER ucfirst %]
     Call No:  [% circ.target_copy.call_number.label %]
     Barcode:  [% circ.target_copy.barcode %]
     Checked Out At: [% circ.circ_lib.name %]
     Due Date: [% date.format(helpers.format_date(circ.due_date),
'%m-%d-%Y') %]

[% END %]

Overdue fines will continue to accrue until items are returned. Items may
be returned and fines paid at any PINES member library. Some libraries also
accept online payments at: https://gapines.org/login

If you have any questions, please contact your home library at:

     [% homelib.parent_ou.name %]
     [% homelib.name %]
     [%- SET addr = homelib.mailing_address -%]
     [%- IF !addr -%] [%- SET addr = homelib.billing_address -%] [%- END %]
     [% addr.street1 %] [% addr.street2 %]
     [% addr.city %], [% addr.state %] [% addr.post_code %]
     [% homelib.phone %]
     [% homelib.email %]

     [%- SET liburl = helpers.get_org_setting(homelib.id, 'lib.info_url')
-%]
     [% liburl %]

     (Please have your library card number available.)


You may also access your account online at: https://gapines.org/login

---------------------------------------------------------------

This is an automatically generated message. Please do not reply. If you
believe you have received this message in error, please contact the library
listed above.






Terran McCanna, PINES Program Manager
------------------------------

Georgia Public Library Service | University System of Georgia

2872 Woodcock Blvd, Suite 250 l Atlanta, GA 30341

(404) 235-7138 | tmccanna at georgialibraries.org

http://help.georgialibraries.org | help at georgialibraries.org

<https://www.facebook.com/georgialibraries>
<https://www.twitter.com/georgialibs>
<https://www.instagram.com/georgialibraries/>
<https://www.twitter.com/georgialibs>

Join our email list <http://georgialibraries.org> for stories of Georgia
libraries making an impact in our communities.



On Mon, May 2, 2022 at 2:26 AM Linda Jansová via Evergreen-general <
evergreen-general at list.evergreen-ils.org> wrote:

> Dear all,
>
> We are on Evergreen 3.6.4 and are trying to make the following trigger
> (notification email) work. We have some other notification emails working
> correctly, so I suppose we probably have something wrong with the trigger
> configuration itself rather than with the email server.
>
> This notification is supposed to send an email to users who have not
> returned their checked-out item(s) in time - it should send the message one
> day after the due date.
>
> Currently, we have the following setup:
>
> *Owning Library*: JAB
>
> *Name: *1 Day Overdue Email Notification - Jabok
>
> *Hook:* checkout.due
>
> *Enabled:* True
>
> *Processing Delay:* 1 day
>
> *Processing Delay Context Field:* due_date
>
> *Processing Group Context Field:* usr
>
> *Reactor: *SendEmail
>
> *Validator:* CircIsOverdue
>
> *Granularity:* Daily
>
> *Max Event Validity Delay:* 2 days
>
> *Template:*
>
> [%- USE date -%]
> [%- user = target.0.usr -%]
> To: [%- params.recipient_email || user.email %]
> From: [%- params.sender_email || default_sender %]
> Subject: Nevracene knihy
>
> Ctenar: [% user.family_name %], [% user.first_given_name %]
>
> Dovolujeme si Vas  upozornit, ze uplynula vypujcni lhuta u nekterych
> vypujcentych knihovnich jednotek. Na Vasem konte zacalo nabyvat zpozdne ve
> vysi 2 Kc za knihovni jednotku a den.
>
> Vypujcky s uplynulou vypujcni lhutou jiz NELZE PRODLOUZIT a proto je nutne
> je prinest k vraceni do knihovny (pokud nejsou rezervovane jinym ctenarem,
> je pote eventualne mozne jejich opetovne pujceni).
> Dokud nebudou vraceny (a zaroven dokud nebudou zaplaceny poplatky za
> zpozdne), je ctenarske konto blokovano a NENI MOZNE PRODLUZOVAT VYPUJCNI
> LHUTU zadnych vypujcenych knihovnich jednotek ani PUJCOVAT NEBO REZERVOVAT
> ZADNE DOKUMENTY. Je take pozastavena moznost splneni drive zadanych
> rezervaci nebo blokaci.
>
>
> Seznam knihovnich jednotech, u kterych jiz uplynula vypujcni lhuta:
>
> [% FOR circ IN target %]
>     [%- copy_details = helpers.get_copy_bib_basics(circ.target_copy.id)
> -%]
>     Nazev: [% copy_details.title %]
>     Autor: [% copy_details.author %]
>     Carovy kon: [% circ.target_copy.barcode %]
>     K vraceni dne: [% date.format(helpers.format_date(circ.due_date),
> '%Y-%m-%d') %]
>
>
> [% END %]
>
> All other available fields are empty in our setup.
>
> Compared to 7 Day Overdue Email Notification from
> https://demo.evergreencatalog.com/eg/staff/admin/local/action_trigger/event_definition
> (which is Evergreen 3.8.0), fields Context Bib Path, Context Item Path and
> Context Library Path are missing from our interface. Have they been added
> to the interface in some of the more recent Evergreen versions? Or is it
> something we have lost along the way when migrating from older Evergreen
> versions (during the upgrade process)? This installation of ours is
> actually more than a decade old and keeps being upgraded each year...
>
> Also, I have noticed that our template actually does not include:
>
> Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt => 1) %]
>
> Auto-Submitted: auto-generated
>
> However, we have another one that seems to be working fine where these two
> lines are also omitted...
>
> The aforementioned 3.8.0 Evergreen demo also has - compared to what we
> have:
>
> *Opt-In Setting Type*: circ.default_overdue_notices_enabled
>
> *Opt-In User** Field:* usr
>
> What is also different is that we have a daily granularity while the demo
> installation does not have any. Also, the demo server has a longer Max
> Event Validity Delay - 8 days - while we only have two (maybe two days are
> not sufficient in this case?).
>
> (I understand that the demo server may not include the pristine setup of
> this trigger as anybody could change it so - probably in theory rather than
> in practice - some non-default values might have been inserted since it was
> last replaced with the original demo/default data. However, I think it may
> be a good starting point for making the comparisons anyway.)
>
> Does anyone have any idea what should be wrong in our configuration? Or
> where else should we look (like library opening hours, granularity values
> accepted by the cron job or something else entirely)?
>
> Thank you in advance for sharing any tips!
>
> Linda
> _______________________________________________
> Evergreen-general mailing list
> Evergreen-general at list.evergreen-ils.org
> http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/evergreen-general/attachments/20220503/55a58358/attachment-0001.htm>


More information about the Evergreen-general mailing list