[SOLVED]Daily job NOT sending email

Showing results for 
Search instead for 
Did you mean: 
Active Member II

[SOLVED]Daily job NOT sending email

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="">();



    actionService.executeAction(mailAction, null);


Any comment welcome.


Luis Camargo

3 Replies

Re: Daily job NOT sending email


Is Alfresco log saying something relevant about this? For example, I would use OOTB support tools for increasing the log details while executing the scheduled job (as an action) in support tools.

Typical problems on notifications are related to bad smtp configurations or wrong permissions on Data Dictionary for notification templates. 




Re: Daily job NOT sending email

Check if your SMTP config is correct, try to telnet and check connectivity.

Additionally, Can you put some additional logs in following methods: checkUsersPasswordExpiration(), configUserCredentialsExpiryDate(..) and notifyUser(..)? Additionally, put log in the if block where you are checking the date left value:

if (userExists && isUserEnabled) {
//LOG here
Date credentialsExpiryDate = authenticationDao.getCredentialsExpiryDate(person.getUserName());
if (credentialsExpiryDate == null) {
} else {
//LOG here
long daysLeft = HTHUtil.getDifferenceDaysFromToday(credentialsExpiryDate);
if (daysLeft >= 0 && daysLeft <= 7) {
//LOG here
notifyUser(person, daysLeft);
} else {
} ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Also, can you enable the debug logs for following:



After making these changes, see if you can capture any logs.

(ACSCE, AWS SAA, Azure Admin)
Active Member II

Re: [SOLVED]Daily job NOT sending email

Thank you very much Abhinav Mishra‌ and Cesar Capillas‌. 

In the end the problem was a incorrect code on my email template. After I enable the debug logs it was easy to identify the problem.

Thank you very much.


Luis Camargo