<div dir="ltr"><div><div><div>Hi ,<br><br></div>I already try your suggestion, and it works. But, when I try to use to_list and to_cc (<a href="https://wiki.eprints.org/w/API:EPrints/Email">https://wiki.eprints.org/w/API:EPrints/Email</a>), I get error. If to_email =&gt; <a href="mailto:blabla@comain.com">blabla@comain.com</a> and I want cc to other email address let say 5 people, what function I must use?<br><br></div>When I try thy this method below, I get error <br>my $bool = $user-&gt;is_staff();<br>my $staff_email = $bool-&gt;get_value( &quot;email&quot; ); #for editor/administrator<br>...<br>to_email =&gt; $staff_email<br><br></div>Error from var/log :  Can&#39;t call method &quot;get_value&quot; without a package or object reference at (eval 663) line 20.\n<br>var/last_changed.timestamp has been modified since the repository config was loaded: reloading!<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 31, 2018 at 6:01 PM, John Salter <span dir="ltr">&lt;<a href="mailto:J.Salter@leeds.ac.uk" target="_blank">J.Salter@leeds.ac.uk</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div link="blue" vlink="purple" lang="EN-GB">
<div class="m_-6125112033558381901WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">That looks OK to me.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">First, try with a hardcoded email address on this line:<u></u><u></u></span></p><span class="">
<p class="MsoNormal">to_email =&gt; <b><span style="color:red;background:white">#EDITOR OR ADMINISTRATOR</span></b><span style="color:red;background:white">
<b>EMAIL?</b></span>,<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u><u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">You need to use single-quotes:<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">    to_email =&gt; &#39;<a href="mailto:the.email@domain.com" target="_blank">the.email@domain.com</a>&#39;,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">if you use double-quotes, it might not work.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Let me know if that helps. If it doesn&#39;t, is there anything in the error log?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">You could add something to put a message into the Apache log to check the email looks like it&#39;s been sent:<u></u><u></u></span></p><span class="">
<p class="MsoNormal">my $userMailOK = EPrints::Email::send_mail(<u></u><u></u></p>
</span><p class="MsoNormal">…<u></u><u></u></p>
<p class="MsoNormal">);<u></u><u></u></p>
<p class="MsoNormal">print STDERR &quot;inbox to buffer email result: $userMailOK\n&quot;;<span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">If that does work, the next question is &#39;how many editors do you have?&#39;.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">If it&#39;s just one (or there more than one, but they use a shared mailbox), hard-coding the email address might be OK.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">If you have lots of editors, and they have different &#39;scopes&#39; (you could allow one editor to process theses, another one to process
 journal articles), then we can do something like:<u></u><u></u></span></p>
<p class="m_-6125112033558381901MsoListParagraph"><u></u><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">         
</span></span></span><u></u><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">get all editors<u></u><u></u></span></p>
<p class="m_-6125112033558381901MsoListParagraph"><u></u><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">         
</span></span></span><u></u><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">see if the item is &#39;in scope&#39; of that editor<u></u><u></u></span></p>
<p class="m_-6125112033558381901MsoListParagraph"><u></u><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><span>-<span style="font:7.0pt &quot;Times New Roman&quot;">         
</span></span></span><u></u><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">email them if it is!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Let me know how you get on!<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Cheers,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">John<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US"> <a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk" target="_blank">eprints-tech-bounces@ecs.<wbr>soton.ac.uk</a> [mailto:<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk" target="_blank">eprints-tech-bounces@<wbr>ecs.soton.ac.uk</a>]
<b>On Behalf Of </b>Ajunk Pracetio<br>
<b>Sent:</b> 31 January 2018 09:13<br>
<b>To:</b> <a href="mailto:eprints-tech@ecs.soton.ac.uk" target="_blank">eprints-tech@ecs.soton.ac.uk</a><br>
<b>Subject:</b> Re: [EP-tech] Ask about frequency of items-under-review mailings:<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi John,<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I already try this and success. But it only for live archive, not for item that just deposited. I already try add below, but I dont know is it right or wrong.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<p class="MsoNormal">$c-&gt;add_dataset_trigger( &quot;eprint&quot;, EP_TRIGGER_STATUS_CHANGE, sub{<br>
    my( %o ) = @_;<br>
 <br>
    my $eprint = $o{dataobj};<br>
    my $old_status = $o{old_status};<br>
    my $new_status = $o{new_status};<br>
 <br>
    my $session = $eprint-&gt;get_session;<br>
 <br>
    my $user = $eprint-&gt;get_user(); <b><span style="color:red">#user that only editor/administrator only</span></b><br>
 <br>
    my $user_email = $user-&gt;get_value( &quot;email&quot; ); #when you are testing, set this to your email - so you don&#39;t spam people!<br>
 <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"> <br>
#   EXAMPLE of a deposit receipt<br>
   if( $old_status eq &quot;inbox&quot; &amp;&amp; $new_status eq &quot;buffer&quot; ){<br>
       # send a deposit receipt?<br>
       # Do something similar to the stuff below - but with different phrases!<br>
<br>
        my $title = $eprint-&gt;render_value( &quot;title&quot; );<br>
        my $users_name = $user-&gt;render_value( &quot;name&quot; );<br>
 <br>
        my $mail = $session-&gt;make_element( &quot;mail&quot; );<br>
        $mail-&gt;appendChild( $session-&gt;html_phrase( &quot;status_change_inbox_to_<wbr>review_body&quot;,<br>
            users_name =&gt; $users_name,<br>
                 title =&gt; $title<br>
        ) );<br>
 <br>
        my $userMailOK = EPrints::Email::send_mail(<br>
            session =&gt; $session,<br>
            langid =&gt; $session-&gt;get_langid,<br>
            to_email =&gt; <b><span style="color:red;background:white">#EDITOR OR ADMINISTRATOR</span></b><span style="color:red;background:white">
<b>EMAIL?</b></span>,<br>
            subject =&gt; $session-&gt;phrase( &quot;status_change_inbox_to_<wbr>review_subject&quot; ),<br>
            message =&gt; $mail,<br>
            sig =&gt; $session-&gt;html_phrase( &quot;mail_sig&quot; )<br>
        );<br>
 <br>
   }<br>
 <br>
 <br>
#    NOTIFICATION FOR LIVE ARCHIVE<br>
    <br>
    if( $old_status eq &quot;buffer&quot; &amp;&amp; $new_status eq &quot;archive&quot; ){<br>
        # you might want to check what the datestamp is - and not send an email if this item has<br>
        # been moved from archive -&gt; buffer -&gt; archive for some reason.<br>
 <br>
        my $title = $eprint-&gt;render_value( &quot;title&quot; );<br>
        my $users_name = $user-&gt;render_value( &quot;name&quot; );<br>
        my $url = $session-&gt;render_link( $eprint-&gt;get_url );<br>
        $url-&gt;appendChild( $session-&gt;make_text( $eprint-&gt;get_url ) );<br>
 <br>
        my $mail = $session-&gt;make_element( &quot;mail&quot; );<br>
        $mail-&gt;appendChild( $session-&gt;html_phrase( &quot;status_change_buffer_to_<wbr>archive_user_body&quot;,<br>
            users_name =&gt; $users_name,<br>
                 title =&gt; $title,<br>
            eprint_url =&gt; $url<br>
        ) );<br>
 <br>
        my $userMailOK = EPrints::Email::send_mail(<br>
            session =&gt; $session,<br>
            langid =&gt; $session-&gt;get_langid,<br>
            to_email =&gt; $user_email,<br>
            subject =&gt; $session-&gt;phrase( &quot;status_change_buffer_to_<wbr>archive_user_subject&quot; ),<br>
            message =&gt; $mail,<br>
            sig =&gt; $session-&gt;html_phrase( &quot;mail_sig&quot; )<br>
        );<br>
 <br>
        # you could check the value of $userMailOK - in case the email wasn&#39;t sent<br>
    } # END of buffer-to-archive<br>
 <br>
});<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Thank you<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Tue, Jan 30, 2018 at 5:13 PM, John Salter &lt;<a href="mailto:J.Salter@leeds.ac.uk" target="_blank">J.Salter@leeds.ac.uk</a>&gt; wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Hi Agung,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Yes - there is a way to do this.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">I wrote this page a while ago to explain how - let me know if there are parts that you don&#39;t understand!</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"><a href="https://wiki.eprints.org/w/Sending_email_when_item_is_made_live_or_deposited" target="_blank">https://wiki.eprints.org/w/<wbr>Sending_email_when_item_is_<wbr>made_live_or_deposited</a></span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">Cheers,</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d">John</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif;color:#1f497d"> </span><u></u><u></u></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">From:</span></b><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,sans-serif" lang="EN-US">
<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk" target="_blank">eprints-tech-bounces@ecs.<wbr>soton.ac.uk</a> [mailto:<a href="mailto:eprints-tech-bounces@ecs.soton.ac.uk" target="_blank">eprints-tech-bounces@<wbr>ecs.soton.ac.uk</a>]
<b>On Behalf Of </b>Ajunk Pracetio<br>
<b>Sent:</b> 28 January 2018 06:52<br>
<b>To:</b> <a href="mailto:eprints-tech@ecs.soton.ac.uk" target="_blank">eprints-tech@ecs.soton.ac.uk</a><br>
<b>Subject:</b> [EP-tech] Ask about frequency of items-under-review mailings:</span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal"> <u></u><u></u></p>
<div>
<p class="MsoNormal"><span class="m_-6125112033558381901m-3409795091675778827gmail-"><span lang="EN">Hi,</span></span><span lang="EN"><br>
<br>
<span class="m_-6125112033558381901m-3409795091675778827gmail-">Is it possible to send email frequencies directly to the editor whenever a depositor uploads an item? Because the setting is only once per day.</span><br>
<br>
<span class="m_-6125112033558381901m-3409795091675778827gmail-">If you have to make modifications, which files should I edit?</span><br>
<br>
<span class="m_-6125112033558381901m-3409795091675778827gmail-">thank you.</span><br>
<br>
<span class="m_-6125112033558381901m-3409795091675778827gmail-">Greetings,</span><br>
<span class="m_-6125112033558381901m-3409795091675778827gmail-">Agung P.W </span></span><br clear="all">
<br>
-- <u></u><u></u></p>
<div>
<p class="MsoNormal">Life isn&#39;t valuable if you don&#39;t have someone to care<u></u><u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" target="_blank">
http://mailman.ecs.soton.ac.<wbr>uk/mailman/listinfo/eprints-<wbr>tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/" target="_blank">http://www.eprints.org/tech.<wbr>php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/" target="_blank">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/" target="_blank">
http://forum.eprints.org/</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal"><br>
<br clear="all">
<br>
-- <u></u><u></u></p>
<div>
<p class="MsoNormal">Life isn&#39;t valuable if you don&#39;t have someone to care<u></u><u></u></p>
</div>
</div>
</div></div></div>
</div>

<br>*** Options: <a href="http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech" rel="noreferrer" target="_blank">http://mailman.ecs.soton.ac.<wbr>uk/mailman/listinfo/eprints-<wbr>tech</a><br>
*** Archive: <a href="http://www.eprints.org/tech.php/" rel="noreferrer" target="_blank">http://www.eprints.org/tech.<wbr>php/</a><br>
*** EPrints community wiki: <a href="http://wiki.eprints.org/" rel="noreferrer" target="_blank">http://wiki.eprints.org/</a><br>
*** EPrints developers Forum: <a href="http://forum.eprints.org/" rel="noreferrer" target="_blank">http://forum.eprints.org/</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Life isn&#39;t valuable if you don&#39;t have someone to care</div>
</div>