09-10-2018 07:54 AM
Hi,
I try to use the default template for my workflow notifications but I get a 500 error code
The notification works if I use these folowings :
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "Adhoc Task " + execution.getVariable('bpm_workflowDescription');
mail.parameters.from = initiator.properties.email;
mail.parameters.text = "It's done";
mail.execute(bpm_package);
However, I get a 500 error code when I use this :
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.template =companyhome.childByNamePath("Data Dictionary/Email Templates/Workflow Notification/wf-email.html.ftl");
var templateArgs = new Array();
templateArgs['workflowTitle'] = "workflowTitle";
var templateModel = new Array();
templateModel['args'] = templateArgs;
mail.parameters.template_model = templateModel;
//mail.parameters.text = "";
mail.parameters.subject = "Adhoc Task " + execution.getVariable('bpm_workflowDescription');
mail.parameters.from = initiator.properties.email;
mail.execute(bpm_package);
The log :
2018-09-07 08:18:19,959 ERROR [action.executer.MailActionExecuter] [http-bio-8080-exec-26] Failed to send email to adresse@mail.com : org.springframework.mail.MailSendException: Failed messages: javax.mail.MessagingException: No MimeMessage content; message exceptions (1) are: Failed message 1: javax.mail.MessagingException: No MimeMessage content
2018-09-07 08:18:19,969 DEBUG [repo.jscript.ScriptLogger] [http-bio-8080-exec-26] org.alfresco.scripts.ScriptException: 08070022 Failed to execute supplied script: 08070021 Failed to send email to:adresse@mail.com
2018-09-07 08:18:19,970 DEBUG [repo.jscript.ScriptLogger] [http-bio-8080-exec-26] Returning 500 status code
When I add this :
logger.log("Template : " + companyhome.childByNamePath("Data Dictionary/Email Templates/Workflow Notification/wf-email.html.ftl"));
logger.log("Template_Data : " + companyhome.childByNamePath("Data Dictionary"));
Template : null
Template_Data : null
Thanks in advance
09-18-2018 12:33 AM
Thanks for your answer.
From now, I am the only one who use the application.
In the node browser when I seach with the noderef of the invite-email_fr.html.ftl file, I get the primary path /app:company_home/app:dictionary/app:email_templates/cm:workflownotification/cm:invite-email_fr.html.ftl
09-18-2018 06:55 PM
Well, that is strange. If you are logged in to Share as admin and you can browse and search for that template, you should be able to use the JavaScript Console to run that print statement and it should work.
Explore our Alfresco products with the links below. Use labels to filter content by product module.