<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem of sending email within try block in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/problem-of-sending-email-within-try-block/m-p/296842#M249972</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have never managed to use try / catch is a JavaScripr rule effectively. it does some very odd things. In my experience the error is always reported despite the try / catch and the transaction rolled back.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Aug 2015 08:16:00 GMT</pubDate>
    <dc:creator>rjohnson</dc:creator>
    <dc:date>2015-08-17T08:16:00Z</dc:date>
    <item>
      <title>Problem of sending email within try block</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-of-sending-email-within-try-block/m-p/296841#M249971</link>
      <description>I wrote a javascript to invoke after a document is created in a folder (through the rule). In this script, I tried to send an email. I put "mail.execute(document)" in the try block, so that it can catch the exception when sending an email (like connection issue to SMTP server, or email address error</description>
      <pubDate>Sun, 16 Aug 2015 18:54:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-of-sending-email-within-try-block/m-p/296841#M249971</guid>
      <dc:creator>gordon_liang</dc:creator>
      <dc:date>2015-08-16T18:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of sending email within try block</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-of-sending-email-within-try-block/m-p/296842#M249972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have never managed to use try / catch is a JavaScripr rule effectively. it does some very odd things. In my experience the error is always reported despite the try / catch and the transaction rolled back.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 08:16:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-of-sending-email-within-try-block/m-p/296842#M249972</guid>
      <dc:creator>rjohnson</dc:creator>
      <dc:date>2015-08-17T08:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of sending email within try block</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-of-sending-email-within-try-block/m-p/296843#M249973</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have not tried try/catch on a rule before, so I can't comment on that. However, if all you want is to propagate an error when there is a problem with executing the mail; try the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;mail.parameters.ignore_send_failure = false;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt; Essentially, this says if the mail actions runs into a problem roll back and report on the logs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It has always worked for me, though I have only done it outside of a rule.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Aug 2015 09:44:40 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-of-sending-email-within-try-block/m-p/296843#M249973</guid>
      <dc:creator>darkredd</dc:creator>
      <dc:date>2015-08-17T09:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Problem of sending email within try block</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/problem-of-sending-email-within-try-block/m-p/296844#M249974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the comments. I just realized the rule of exception handling within the javascript of Alfresco. The try/catch block looks like runnig well in the script, however the error is not ignored by the Alfresco rule. Looks like this is a design intention of the Alfresco rules, though it would be weird to me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As for the ignore_send_failure parameter… Actually what I want is NOT to propagate an error when sending an email. Because I would like the creation of document be success anyway, no matter whether a mail is sent properly or not. Furthermore, the mail would be sent to a couple of users. If the mail address of one user is not right, it doesn't make sense to stop sending to the other users… In this case, shall I set it to ignore_send_failure = true?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;BTW, where to find the official documents of the send mail action? In the doc of Alfresco, I can only find the high level documentation of actions but not the specific ones.&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Aug 2015 04:06:09 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/problem-of-sending-email-within-try-block/m-p/296844#M249974</guid>
      <dc:creator>gordon_liang</dc:creator>
      <dc:date>2015-08-18T04:06:09Z</dc:date>
    </item>
  </channel>
</rss>

