AnsweredAssumed Answered

[SOLVED]Daily job NOT sending email

Question asked by luiscesarinfo on Aug 1, 2019
Latest reply on Aug 3, 2019 by luiscesarinfo

Hi Guys,

I'm working with Alfresco 5.2 on a AWS Linux environment and I have set a job to run daily at 1am. The job it self is running perfectly but an email that should be sent to the user is not being sent.

 

Everything seem working fine and when I call "executeAction()" nothing happens.

Testing the code on my development environment, it is working fine and I am getting the email.

 

To send the email, I'm implementing an Action (see class attached) as below:


private void notifyUser(PersonInfo person, long daysLeft) {

    Action mailAction = actionService.createAction(MailActionExecuter.NAME);

    mailAction.setParameterValue(MailActionExecuter.PARAM_SUBJECT, "Embed software: Password expiration");

    mailAction.setParameterValue(MailActionExecuter.PARAM_TO, serviceRegistry.getNodeService().getProperty(person.getNodeRef(), ContentModel.PROP_EMAIL));

    mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE, getEmailTemplate());

    Map<string, serializable=""> templateArgs = new HashMap<string, serializable="">();

    templateArgs.put("firstname", person.getFirstName());

    templateArgs.put("daysLeft", daysLeft);

    templateArgs.put("username", person.getUserName());

    Map<string, serializable=""> templateModel = new HashMap<string, serializable="">();

    templateModel.put("args",(Serializable)templateArgs);

    mailAction.setParameterValue(MailActionExecuter.PARAM_TEMPLATE_MODEL,(Serializable)templateModel);

    actionService.executeAction(mailAction, null);

}


Any comment welcome.

 

Regards,

Luis Camargo

Outcomes