<?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: how to send mail  using  ActionExecuterAbstractBase? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100284#M28954</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please check all log files including catalina.out log as well. Enable these debug logs and try again to see what error you can find:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;log4j.logger.org.alfresco.repo.action=debug&lt;BR /&gt;log4j.logger.org.alfresco.repo.action.executer.MailActionExecuter=debug&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you are not catching any generic exception somewhere which may not be logged.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Jul 2019 13:28:18 GMT</pubDate>
    <dc:creator>abhinavmishra14</dc:creator>
    <dc:date>2019-07-10T13:28:18Z</dc:date>
    <item>
      <title>how to send mail  using  ActionExecuterAbstractBase?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100277#M28947</link>
      <description>I did this configuration&amp;nbsp;email.server.enabled=trueemail.server.port=25email.server.domain=alfresco.comemail.inbound.unknownUser=anonymousemail.server.allowed.senders=.*In Class&amp;nbsp;Properties mailServerProperties = new Properties(); mailServerProperties = System.getProperties(); mailServerProperties.put</description>
      <pubDate>Tue, 09 Jul 2019 11:45:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100277#M28947</guid>
      <dc:creator>dharmraj</dc:creator>
      <dc:date>2019-07-09T11:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to send mail  using  ActionExecuterAbstractBase?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100278#M28948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you clarify whether you want to send emails without attachments or with attachments ?&lt;/P&gt;&lt;P&gt;There is an action OOTB which allows to send emails to a user or a group but attachment feature is not available as of now.&amp;nbsp;&lt;/P&gt;&lt;P&gt;This action class extends ActionExecuterAbstractBase as well:&amp;nbsp;org.alfresco.repo.action.executer.MailActionExecuter&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/repo/action/executer/MailActionExecuter.java" rel="nofollow noopener noreferrer"&gt;https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/repo/action/executer/MailActionExecuter.java&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6;" width="100%"&gt;&lt;THEAD&gt;&lt;TR style="background-color: #efefef;"&gt;&lt;TH&gt;&lt;P&gt;Here is sample code snippet using OOTB &lt;STRONG&gt;MailActionExecuter&amp;nbsp;&lt;/STRONG&gt;which may be helpful.&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;/THEAD&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;private String fromEmailAddress;&lt;BR /&gt; private String templateSpace;&lt;BR /&gt; private NodeService nodeService;&lt;BR /&gt; private ActionService actionService;&lt;BR /&gt; private PersonService personService;&lt;BR /&gt; private NamespaceService namespaceService;&lt;BR /&gt; private SearchService searchService;&lt;/P&gt;&lt;P&gt;//Setter and Getter methods of above items&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; public void sendEmailToGroupOrEmailId(final String subject,&lt;BR /&gt; final String templateString, final Map&amp;lt;String, Serializable&amp;gt; model,&lt;BR /&gt; final Serializable recipients) {&lt;BR /&gt; //Example snippet Send to group&lt;BR /&gt; final ArrayList&amp;lt;Serializable&amp;gt; recipientList = new ArrayList&amp;lt;Serializable&amp;gt;();&lt;BR /&gt; if (recipients instanceof ArrayList) {&lt;BR /&gt; recipientList.addAll((Collection&amp;lt;Serializable&amp;gt;) recipients);&lt;BR /&gt; } else {&lt;BR /&gt; recipientList.add(recipients);&lt;BR /&gt; }&lt;BR /&gt; final Action action = actionService.createAction(MailActionExecuter.NAME);&lt;BR /&gt; action.setParameterValue(MailActionExecuter.PARAM_TO_MANY, recipientList); //A group or email id.&lt;BR /&gt; action.setParameterValue(MailActionExecuter.PARAM_FROM, fromEmailAddress); //From address is configured in global properties&lt;BR /&gt; action.setParameterValue(MailActionExecuter.PARAM_SUBJECT, subject);&lt;BR /&gt; action.setParameterValue(MailActionExecuter.PARAM_TEMPLATE, getMailTemplate(templateString)); //Email template path. e.g. : /Company Home/Data Dictionary/Email Templates/my_operation_email.html.ftl&lt;BR /&gt; action.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL, (Serializable) model); //a map containing parametrers you want to pass within email template.&lt;BR /&gt; actionService.executeAction(action, null);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;//If you have person's user id, this method will get the email id via its person node and intitiate email action&lt;BR /&gt; public void sendEmailToUserId(final String uid, final String subject,&lt;BR /&gt; final String templateString, final String message,&lt;BR /&gt; final Map&amp;lt;String, Serializable&amp;gt; model) { &lt;BR /&gt; final NodeRef personNodeRef = personService.getPerson(uid);&lt;BR /&gt; final String email = (String) nodeService.getProperty(personNodeRef, ContentModel.PROP_EMAIL);&lt;BR /&gt; sendEmailToGroupOrEmailId(subject, templateString, model, email);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;private String getMailTemplate(final String templateString) throws SendMailException {&lt;BR /&gt; String template = StringUtils.EMPTY;&lt;BR /&gt; if(templateString.indexOf('/') == -1) {&lt;BR /&gt; template = nodeService.getChildByName(getTemplatesSpace(), ContentModel.ASSOC_CONTAINS, templateString).toString();&lt;BR /&gt; } else {&lt;BR /&gt; template = templateString;&lt;BR /&gt; }&lt;BR /&gt; return template;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;private NodeRef getTemplatesSpace() throws SendMailException {&lt;BR /&gt; if (templatesSpaceRef == null) {&lt;BR /&gt; templatesSpaceRef = selectNodeByDisplayPath(templateSpace);&lt;BR /&gt; }&lt;BR /&gt; return templatesSpaceRef;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; public NodeRef selectNodeByDisplayPath(final String path)&lt;BR /&gt; throws InvalidNodeRefException, XPathException,&lt;BR /&gt; IllegalArgumentException {&lt;BR /&gt; String nodePath = path;&lt;BR /&gt; NodeRef nodeRef = null;&lt;BR /&gt; if (path.startsWith("/")) {&lt;BR /&gt; nodePath = path.substring(1);&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;final List&amp;lt;NodeRef&amp;gt; selectedNodes = searchService.selectNodes(nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE),&lt;BR /&gt; nodePath, null, namespaceService, false);&lt;BR /&gt; if (selectedNodes != null &amp;amp;&amp;amp; !selectedNodes.isEmpty()) {&lt;BR /&gt; nodeRef = selectedNodes.get(0);&lt;BR /&gt; }&lt;BR /&gt; return nodeRef;&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone has implemented a custom MailExecutorAction by taking the reference of OOTB action class which can send the attachments as well. I have not tested it but you may want to try this:&amp;nbsp;&lt;A _jive_internal="true" href="https://community.alfresco.com/docs/DOC-6574-send-html-mail-with-attachments" rel="nofollow noopener noreferrer"&gt;https://community.alfresco.com/docs/DOC-6574-send-html-mail-with-attachments&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:53:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100278#M28948</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2019-07-09T12:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: how to send mail  using  ActionExecuterAbstractBase?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100279#M28949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Abhinav,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i&amp;nbsp; want to send a mail using inbound ACS setting to any user .So&amp;nbsp; i used&amp;nbsp;ActionExecuterAbstractBase to send a mail .&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2019 13:24:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100279#M28949</guid>
      <dc:creator>dharmraj</dc:creator>
      <dc:date>2019-07-09T13:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: how to send mail  using  ActionExecuterAbstractBase?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100280#M28950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Instead of creating traditional email sender logic/methods and implementing the action. I would suggest to use OOTB way of sending emails. It is also an action which can be executed synchronously/asynchronously. You can use a custom email template with this approach where you can pass some parameters, add custom logo and format as per your liking. It will also support sending email to an Alfresco Group. e.g. GROUP_Administrators. If you pass this value, all the users who are part of this group would receive emails. You don't have to extract each user's email id..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2019 13:32:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100280#M28950</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2019-07-09T13:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to send mail  using  ActionExecuterAbstractBase?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100281#M28951</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any configuration i have to do&amp;nbsp; for from , host and port&amp;nbsp; in alfresco global properties&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2019 13:54:55 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100281#M28951</guid>
      <dc:creator>dharmraj</dc:creator>
      <dc:date>2019-07-09T13:54:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to send mail  using  ActionExecuterAbstractBase?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100282#M28952</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes. you would&amp;nbsp; need following configurations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mail.host=smtp.xyz.com&lt;BR /&gt;mail.port=25&lt;BR /&gt;mail.encoding=UTF-8&lt;BR /&gt;mail.from.default=alfresco-local@xyz.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can bootstratp your email templates to&amp;nbsp;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;/Company Home/Data Dictionary/Email Templates/ folder and get the template at run time while sending email. You can refer here for bootstrapping template:&amp;nbsp;&lt;A href="https://docs.alfresco.com/4.2/concepts/dev-extensions-modules-bootstrapping-files-spaces-xml.html" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/4.2/concepts/dev-extensions-modules-bootstrapping-files-spaces-xml.html&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;You can find the ootb email templates in&amp;nbsp;&lt;SPAN&gt;/Company Home/Data Dictionary/Email Templates/ folder and you can take reference from any of the templates to create your custom template if needed.&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&lt;SPAN&gt;The sample method provided above:&amp;nbsp;&lt;SPAN style="background-color: #ffffff;"&gt;getMailTemplate(final String templateString) needs the name of the template file and it returns the full path for the method which uses the template for sending email..&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #727174; background-color: #ffffff;"&gt;&lt;SPAN style="background-color: #ffffff; "&gt;e.g.&amp;nbsp;getMailTemplate("my_operation_email.html.ftl")&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 09 Jul 2019 14:18:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100282#M28952</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2019-07-09T14:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to send mail  using  ActionExecuterAbstractBase?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100283#M28953</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt; Action mailAction = actionService.createAction(MailActionExecuter.NAME);&lt;BR /&gt; mailAction.setExecuteAsynchronously(false);&lt;BR /&gt; mailAction.setParameterValue(MailActionExecuter.PARAM_TO, to);&lt;BR /&gt; mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, subject);&lt;BR /&gt; &lt;BR /&gt; actionService.executeAction(mailAction, null);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;I am not getting any error . But mail is not going&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2019 07:40:52 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100283#M28953</guid>
      <dc:creator>dharmraj</dc:creator>
      <dc:date>2019-07-10T07:40:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to send mail  using  ActionExecuterAbstractBase?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100284#M28954</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please check all log files including catalina.out log as well. Enable these debug logs and try again to see what error you can find:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;log4j.logger.org.alfresco.repo.action=debug&lt;BR /&gt;log4j.logger.org.alfresco.repo.action.executer.MailActionExecuter=debug&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Make sure you are not catching any generic exception somewhere which may not be logged.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Jul 2019 13:28:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100284#M28954</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2019-07-10T13:28:18Z</dc:date>
    </item>
    <item>
      <title>Re: how to send mail  using  ActionExecuterAbstractBase?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100285#M28955</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To Send Email,you need to unable outbound email configuration.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.alfresco.com/6.1/concepts/email.html" rel="nofollow noopener noreferrer"&gt;https://docs.alfresco.com/6.1/concepts/email.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ex.&amp;nbsp;&lt;/P&gt;&lt;P&gt;mail.host=smtp.gmail.com&lt;BR /&gt;mail.port=465&lt;BR /&gt;mail.encoding=UTF-8&lt;BR /&gt;mail.username=xxx@gmail.com&lt;BR /&gt;mail.password=xxxx&lt;BR /&gt;mail.protocol=smtps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ActionService actionService = serviceRegistry.getActionService();&lt;/P&gt;&lt;P&gt;Action mailAction = actionService.createAction(MailActionExecuter.NAME);&lt;/P&gt;&lt;P&gt;mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, subject);&lt;/P&gt;&lt;P&gt;mailAction.setParameterValue(MailActionExecuter.PARAM_TO, email);&lt;/P&gt;&lt;P&gt;actionService.executeAction(mailAction, null);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:xxx@gmail.com" rel="nofollow noopener noreferrer"&gt;xxx@gmail.com&lt;/A&gt;&amp;nbsp;This account must be less sucure app.&lt;/P&gt;&lt;P&gt;&lt;A href="https://myaccount.google.com/lesssecureapps" rel="nofollow noopener noreferrer"&gt;https://myaccount.google.com/lesssecureapps&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sanjay Bandhniya&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.contcentric.com/" rel="nofollow noopener noreferrer"&gt;Contcentric&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Jul 2019 04:47:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-send-mail-using-actionexecuterabstractbase/m-p/100285#M28955</guid>
      <dc:creator>sp2</dc:creator>
      <dc:date>2019-07-11T04:47:39Z</dc:date>
    </item>
  </channel>
</rss>

