<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">
<p style="line-height: 100%; margin-bottom: 0cm">
Hi everyone,</p>
<p style="line-height: 100%; margin-bottom: 0cm">As we have not
managed to find a solution yet, we have examined the
documentation
(<a
href="https://docs.evergreen-ils.org/eg/docs/3.9/admin/actiontriggers.html"
class="moz-txt-link-freetext">https://docs.evergreen-ils.org/eg/docs/3.9/admin/actiontriggers.html</a>)
again and have found out that a JSON custom filters can be
added:</p>
<p style="line-height: 100%; margin-bottom: 0cm">--custom-filters=[filter_file]:
File containing a JSON Object which describes any hooks that
should
use a user-defined filter to find their target objects. Defaults
to:
/openils/conf/action_trigger_filters.json</p>
<p style="line-height: 100%; margin-bottom: 0cm">Should the
default
(example) file</p>
<p style="line-height: 100%; margin-bottom: 0cm"><a
href="https://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/examples/action_trigger_filters.json.example;h=c56559f584c148b3a90808df6bb3c650fba0c3dd;hb=HEAD"
class="moz-txt-link-freetext">https://git.evergreen-ils.org/?p=Evergreen.git;a=blob;f=Open-ILS/examples/action_trigger_filters.json.example;h=c56559f584c148b3a90808df6bb3c650fba0c3dd;hb=HEAD</a></p>
<p style="line-height: 100%; margin-bottom: 0cm">be okay? Or
should
some changes be made to it so that the
biblio.format.record_entry.email hook actually sends the emails?<b><br>
</b><br>
</p>
Anyway, we believe
that the following line from our crontab should take care of
sending
out the emails resulting from the processing of the aforementioned
hook:
<p style="line-height: 100%; margin-bottom: 0cm">*/5 * * * * .
~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl
--osrf-config $SRF_CORE --run-pending</p>
<p style="line-height: 100%; margin-bottom: 0cm">But maybe we are
mistaken to assume that this trigger (without any granularity)
is
handled using this crontab command?</p>
<p style="line-height: 100%; margin-bottom: 0cm">Any hints as to
what
and where check are much appreciated!</p>
<p style="line-height: 100%; margin-bottom: 0cm">Linda</p>
<p style="line-height: 100%; margin-bottom: 0cm"><br>
</p>
</div>
<div class="moz-cite-prefix">
<style type="text/css">p { line-height: 115%; margin-bottom: 0.25cm; background: transparent }a:link { color: #000080; so-language: zxx; text-decoration: underline }</style>On
6/29/22 16:58, Linda Jansová wrote:<br>
</div>
<blockquote type="cite"
cite="mid:35765a06-3226-c59f-f4c5-1aeeb5510119@gmail.com">
<p>Dear all,</p>
<p>We are trying to make our action triggers work - we are on a
3.6 system and so far we have not found a working solution for a
trigger that would send an email after a bib record is created.<br>
</p>
<p>As we suspect that there might be something wrong with our
crontab, attached is its current crontab setup.</p>
<p>Bellow are two action triggers which we have (both
unsuccessfully) tried. The first one uses our original template
code (which - for some reason - had worked before we upgraded to
3.6 last year) and the second one uses the template code from a
3.9 community demo system
(<a class="moz-txt-link-freetext"
href="https://demo.evergreencatalog.com/eg2/en-US/staff/admin/local/action_trigger/event_definition/31"
moz-do-not-send="true">https://demo.evergreencatalog.com/eg2/en-US/staff/admin/local/action_trigger/event_definition/31</a>).
I am well aware that there is a version mismatch in the second
case but we decided to at least give it a try before digging
deeper.<br>
</p>
<p><b> Action trigger with original template code and settings
(Evergreen 3.6):</b></p>
<p><b>Owning Library: </b>CONS<b><br>
Name:</b> biblio.record_entry.email<b><br>
Hook: </b>biblio.format.record_entry.email<b><br>
Enabled:</b> ticked<b><br>
Processing Delay:</b> 00:00:00<b><br>
Processing Delay Context Field:</b> empty<b><br>
Processing Group Context Field:</b> owner<b><br>
Reactor:</b> SendEmail<b><br>
Validator:</b> NOOP_True<b><br>
Event Repeatability Delay:</b> empty</p>
<b>Definition ID:</b> 165<b><br>
Failure Cleanup:</b> DeleteTempBiblioBucket<b><br>
Granularity:</b> empty<b><br>
Max Event Validity Delay:</b> empty<b><br>
Message Library Path:</b> empty<b><br>
Message Template:</b> empty<b><br>
Message Title:</b> empty<b><br>
Message User Path:</b> empty<b><br>
Opt-In Setting Type:</b> empty<b><br>
Opt-In User Field:</b> empty<b><br>
Retention Interval:</b> empty<b><br>
Success Cleanup:</b> DeleteTempBiblioBucket<b><br>
Template:</b>
<p>[%- SET user = target.0.owner -%]</p>
<p>To: [%- params.recipient_email || user.email %]</p>
<p>From: [%- params.sender_email || default_sender %]</p>
<p>Subject: Informace o dokumentech v katalogu </p>
<p><br>
</p>
<p>[% FOR cbreb IN target %][% title = '' %]</p>
<p>[% FOR item IN cbreb.items;</p>
<p> bre_id = item.target_biblio_record_entry;</p>
<p><br>
</p>
<p> bibxml = helpers.unapi_bre(bre_id, {flesh => '{mra}'});</p>
<p> FOR part IN bibxml.findnodes('//*[@tag="245"]/*[@code="a" or
@code="b"]');</p>
<p> title = title _ part.textContent;</p>
<p> END;</p>
<p><br>
</p>
<p> author =
bibxml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent;</p>
<p> item_type =
bibxml.findnodes('//*[local-name()="attributes"]/*[local-name()="field"][@name="item_type"]').getAttribute('coded-value');</p>
<p> publisher = bibxml.findnodes('//*[@tag="260" or
@tag="264"]/*[@code="b"]').textContent;</p>
<p> pubdate = bibxml.findnodes('//*[@tag="260" or
@tag="264"]/*[@code="c"]').textContent;</p>
<p> isbn =
bibxml.findnodes('//*[@tag="020"]/*[@code="a"]').textContent;</p>
<p> issn =
bibxml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent;</p>
<p> upc =
bibxml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent;</p>
<p>%]</p>
<p> </p>
<p><br>
</p>
<p>Číslo záznamu [% bre_id %]</p>
<p>[% title %] [% author %]</p>
<p>[% publisher %] [% pubdate %]</p>
<p>[% IF isbn %]ISBN: [% isbn %][% END %][% IF issn %]ISSN: [%
issn %][% END %]</p>
<p>Odkaz na záznam ve Společném katalogu Evergreen: <a
class="moz-txt-link-freetext"
href="http://spok.jabok.cuni.cz/eg/opac/record/"
moz-do-not-send="true">http://spok.jabok.cuni.cz/eg/opac/record/</a>[%
bre_id %]</p>
<p>[% END %]</p>
<p>[% END %]</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>-----------</p>
<p>TIP: Odkaz na záznam(y) v katalogu vaší knihovny:</p>
<p><br>
</p>
<p>Pokud chcete vytvořit odkaz na knihu/dokument přímo do katalogu
vaší knihovny, přidejte čísla záznamu na konec níže uvedeného
URL vaší knihovny (za poslední lomítko):</p>
<p>- Knihovna Jabok: <a class="moz-txt-link-freetext"
href="https://knihovna.jabok.cuni.cz/eg/opac/record/"
moz-do-not-send="true">https://knihovna.jabok.cuni.cz/eg/opac/record/</a></p>
<p>- Evangelikální teologický seminář: <a
class="moz-txt-link-freetext"
href="https://ets.jabok.cuni.cz/eg/opac/record/"
moz-do-not-send="true">https://ets.jabok.cuni.cz/eg/opac/record/</a>
</p>
<p>- Jáchymka: <a class="moz-txt-link-freetext"
href="https://jachymka.jabok.cuni.cz/eg/opac/record/"
moz-do-not-send="true">https://jachymka.jabok.cuni.cz/eg/opac/record/</a></p>
<p>- Katolický domov studujících: <a
class="moz-txt-link-freetext"
href="https://kds.jabok.cuni.cz/eg/opac/record/"
moz-do-not-send="true">https://kds.jabok.cuni.cz/eg/opac/record/</a>
</p>
<p>- Člověk v tísni: <a class="moz-txt-link-freetext"
href="https://clovekvtisni.jabok.cuni.cz/eg/opac/record/"
moz-do-not-send="true">https://clovekvtisni.jabok.cuni.cz/eg/opac/record/</a>
</p>
<p>- Hospic Dobrého Pastýře: <a class="moz-txt-link-freetext"
href="https://dobrypastyr.jabok.cuni.cz/eg/opac/record/"
moz-do-not-send="true">https://dobrypastyr.jabok.cuni.cz/eg/opac/record/</a>
</p>
<p> </p>
<p><br>
</p>
<p><br>
</p>
<p><b> Action trigger with template code from the community demo
server (Evergreen 3.9):</b></p>
<p><b>Owning Library:</b> CONS<b><br>
Name:</b> BibliografickeZaznamyEmail<b><br>
Hook:</b> biblio.format.record_email</p>
<b>Enabled:</b> ticked<b><br>
Processing Delay:</b> 00:00:00<b><br>
Processing Delay Context Field:</b> empty<b><br>
Processing Group Context Field:</b> owner<b><br>
Reactor: </b>SendEmail<b><br>
Validator:</b> NOOP_True<b><br>
Event Repeatability Delay:</b> empty<b><br>
Definition ID:</b> 213<b><br>
Failure Cleanup:</b> DeleteTempBiblioBucket<b><br>
Granularity:</b> empty<b><br>
Max Event Validity Delay:</b> empty<b><br>
Message Library Path:</b> empty<b><br>
Message Template:</b> empty<b><br>
Message Title:</b> empty<b><br>
Message User Path:</b> empty<b><br>
Opt-In Setting Type:</b> empty<b><br>
Opt-In User Field:</b> empty<b><br>
Retention Interval:</b> empty<b><br>
Success Cleanup:</b> DeleteTempBiblioBucket<b><br>
Template:</b>
<p>[%- USE date -%]</p>
<p>[%- SET user = target.0.owner -%]</p>
<p>To: [%- params.recipient_email || user_data.0.email ||
user.email %]</p>
<p>From: [%- params.sender_email || default_sender %]</p>
<p>Date: [%- date.format(date.now, '%a, %d %b %Y %T -0000', gmt
=> 1) %]</p>
<p>Subject: [%- user_data.0.subject || 'Bibliographic Records' %]</p>
<p>Auto-Submitted: auto-generated</p>
<p><br>
</p>
<p>[%- FOR cbreb IN target;</p>
<p><br>
</p>
<p> flesh_list = '{mra';</p>
<p> IF user_data.0.type == 'full';</p>
<p> flesh_list = flesh_list _ ',holdings_xml,acp';</p>
<p> IF params.holdings_limit;</p>
<p> flimit = 'acn=>' _ params.holdings_limit _ ',acp=>' _
params.holdings_limit;</p>
<p> END;</p>
<p> END;</p>
<p> flesh_list = flesh_list _ '}';</p>
<p><br>
</p>
<p> item_list = helpers.sort_bucket_unapi_bre(cbreb.items,{flesh
=> flesh_list, site => user_data.0.context_org,
flesh_limit => flimit}, user_data.0.sort_by,
user_data.0.sort_dir);</p>
<p><br>
</p>
<p>FOR item IN item_list -%]</p>
<p><br>
</p>
<p>[% loop.count %]/[% loop.size %]. Bib ID# [% item.id %]</p>
<p>[% IF item.isbn %]ISBN: [% item.isbn _ "\n" %][% END -%]</p>
<p>[% IF item.issn %]ISSN: [% item.issn _ "\n" %][% END -%]</p>
<p>[% IF item.upc %]UPC: [% item.upc _ "\n" %][% END -%]</p>
<p>Title: [% item.title %]</p>
<p>[% IF item.author %]Author: [% item.author _ "\n" %][% END -%]</p>
<p>Publication Info: [% item.publisher %] [% item.pubdate %]</p>
<p>Item Type: [% item.item_type %]</p>
<p>[% IF user_data.0.type == 'full' && item.holdings.size
== 0 %]</p>
<p> * No items for this record at the selected location</p>
<p>[%- END %]</p>
<p>[% FOR cp IN item.holdings -%]</p>
<p> * Library: [% cp.circ_lib %]</p>
<p> Location: [% cp.location %]</p>
<p> Call Number: [% cp.prefix _ ' ' _ cp.callnumber _ ' ' _
cp.suffix %]</p>
<p>[% IF cp.parts %] Parts: [% cp.parts _ "\n" %][% END -%]</p>
<p> Status: [% cp.status_label %]</p>
<p> Barcode: [% cp.barcode %]</p>
<p><br>
</p>
<p>[% END -%]</p>
<p>[%- END -%]</p>
<p>[%- END -%]</p>
<p><br>
</p>
<p>Do you have any idea about what might be preventing the trigger
from working properly? Or could you please share your working
config?<br>
</p>
<p>Or is there a way to switch on a debug mode in logging that
could shed more light on what is happening in our system when it
comes to action triggers and emails?</p>
<p>Thank you very much for any hints!</p>
<p>Linda<br>
</p>
<p><b> </b> </p>
</blockquote>
<p><br>
</p>
</body>
</html>