<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <div class="moz-cite-prefix">Dear Michele,</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Thank you for highlighting this bug!<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">I have summed up your observation and
      added it as a comment to the bug so that it is easier for others
      to figure this out (and look forward for the patch to be included
      in the future releases :-)!</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Linda<br>
    </div>
    <br>
    <div class="moz-cite-prefix">On 7/6/22 17:24, Morgan, Michele wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CADwhoNJtB=B2pqnmMbrjvaqu7BVALWEORV7v9o9wOMpGzXK2dA@mail.gmail.com">
      <div dir="ltr">
        <div class="gmail_default">Hi Linda,</div>
        <div class="gmail_default"><br>
        </div>
        <div class="gmail_default">Since the purpose of a custom filter
          is to further limit events that are being created, adding one
          would not help if no events are currently succeeding.</div>
        <div class="gmail_default"><br>
        </div>
        <div class="gmail_default">Perhaps you are running into this
          launchpad bug:</div>
        <div class="gmail_default"><br>
        </div>
        <div class="gmail_default"><a
            href="https://bugs.launchpad.net/evergreen/+bug/1955079"
            moz-do-not-send="true" class="moz-txt-link-freetext">https://bugs.launchpad.net/evergreen/+bug/1955079</a><br>
        </div>
        <div class="gmail_default"><br>
        </div>
        <div class="gmail_default">Since your triggers are using the
          same hook and reactor as the one that emails records from the
          catalog, I would suspect yours would also be affected by this
          bug.</div>
        <div class="gmail_default"><br>
        </div>
        <div class="gmail_default">Hope this is helpful,</div>
        <div class="gmail_default">Michele</div>
        <div class="gmail_default"><br>
        </div>
        <div>
          <div dir="ltr" class="gmail_signature"
            data-smartmail="gmail_signature">
            <div dir="ltr">
              <div dir="ltr">
                <div dir="ltr">
                  <div dir="ltr">
                    <div dir="ltr">
                      <div><span>--</span><br>
                      </div>
                      <div>Michele M. Morgan, <span>Technical Support
                          Analyst<br>
                        </span></div>
                      <div><span>North of Boston Library Exchange,
                          Danvers Massachusetts</span></div>
                      <div><span><a href="mailto:mmorgan@noblenet.org"
                            target="_blank" moz-do-not-send="true"
                            class="moz-txt-link-freetext">mmorgan@noblenet.org</a></span></div>
                      <div><br>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
        <br>
      </div>
      <br>
      <div class="gmail_quote">
        <div dir="ltr" class="gmail_attr">On Wed, Jul 6, 2022 at 4:49 AM
          Linda Jansová via Evergreen-general <<a
            href="mailto:evergreen-general@list.evergreen-ils.org"
            moz-do-not-send="true" class="moz-txt-link-freetext">evergreen-general@list.evergreen-ils.org</a>>
          wrote:<br>
        </div>
        <blockquote class="gmail_quote">
          <div>
            <div>
              <p> Hi everyone,</p>
              <p>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"
                  target="_blank" moz-do-not-send="true"
                  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>--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>Should the default (example) file</p>
              <p><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"
                  target="_blank" moz-do-not-send="true"
                  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>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>*/5 * * * * . ~/.bashrc && $EG_BIN_DIR/<a
                  href="http://action_trigger_runner.pl" target="_blank"
                  moz-do-not-send="true">action_trigger_runner.pl</a>
                --osrf-config $SRF_CORE --run-pending</p>
              <p>But maybe we are mistaken to assume that this trigger
                (without any granularity) is handled using this crontab
                command?</p>
              <p>Any hints as to what and where check are much
                appreciated!</p>
              <p>Linda</p>
              <p><br>
              </p>
            </div>
            <div> On 6/29/22 16:58, Linda Jansová wrote:<br>
            </div>
            <blockquote type="cite">
              <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
href="https://demo.evergreencatalog.com/eg2/en-US/staff/admin/local/action_trigger/event_definition/31"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">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
                  href="http://spok.jabok.cuni.cz/eg/opac/record/"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">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
                  href="https://knihovna.jabok.cuni.cz/eg/opac/record/"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">https://knihovna.jabok.cuni.cz/eg/opac/record/</a></p>
              <p>- Evangelikální teologický seminář: <a
                  href="https://ets.jabok.cuni.cz/eg/opac/record/"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">https://ets.jabok.cuni.cz/eg/opac/record/</a>
              </p>
              <p>- Jáchymka: <a
                  href="https://jachymka.jabok.cuni.cz/eg/opac/record/"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">https://jachymka.jabok.cuni.cz/eg/opac/record/</a></p>
              <p>- Katolický domov studujících: <a
                  href="https://kds.jabok.cuni.cz/eg/opac/record/"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">https://kds.jabok.cuni.cz/eg/opac/record/</a>
              </p>
              <p>- Člověk v tísni: <a
                  href="https://clovekvtisni.jabok.cuni.cz/eg/opac/record/"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">https://clovekvtisni.jabok.cuni.cz/eg/opac/record/</a>
              </p>
              <p>- Hospic Dobrého Pastýře: <a
                  href="https://dobrypastyr.jabok.cuni.cz/eg/opac/record/"
                  target="_blank" moz-do-not-send="true"
                  class="moz-txt-link-freetext">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# [% <a
                  href="http://item.id" target="_blank"
                  moz-do-not-send="true">item.id</a> %]</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>
          </div>
          _______________________________________________<br>
          Evergreen-general mailing list<br>
          <a href="mailto:Evergreen-general@list.evergreen-ils.org"
            target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">Evergreen-general@list.evergreen-ils.org</a><br>
          <a
href="http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">http://list.evergreen-ils.org/cgi-bin/mailman/listinfo/evergreen-general</a><br>
        </blockquote>
      </div>
    </blockquote>
    <p><br>
    </p>
  </body>
</html>