AnsweredAssumed Answered

How to trigger an action with java?

Question asked by elcamino on May 29, 2018
Latest reply on May 30, 2018 by jpotts

Alfresco Community (Build: 201707)

    - Alfresco Platform:    5.2.g
    - Alfresco Share:        5.2.f

### Outbound SMTP configuration properties - Working example ###
# Sample Gmail settings


Project dependency:
compile group: 'org.alfresco', name: 'alfresco-repository', version: '6.50'  //




I would like to send a test email with the alfresco built in "send email" action.

What are the theoretical steps needed to do so ?


1. Include alfresco-repository dependency in the project

2. Create _Alfresco_sendmail() method (see test code below)

3. And now im a little lost, what next ?

3.1. As you notice there is no authentication hire, what is the logic behind the authentication user pass server ip Where to put those? From what I understand I can not do it with CMIS1.1


Hire is my test code.

public void alfrescoSendMail() {'   // replaced _Alfresco_sendmail() with alfrescoSendMail
ActionService actionService = serviceRegistry.getActionService();
Action mailAction = actionService.createAction(MailActionExecuter.NAME);
mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, "Hello Mathew!");
mailAction.setParameterValue(MailActionExecuter.PARAM_TO, "");
mailAction.setParameterValue(MailActionExecuter.PARAM_FROM, "");
mailAction.setParameterValue(MailActionExecuter.PARAM_TEXT, "Test message!");
actionService.executeAction(mailAction, null);