AnsweredAssumed Answered

Passing Parameter to Freemarker

Question asked by nunuts on May 8, 2012
Latest reply on May 17, 2012 by amandaluniz_z
Hello,
I'm trying to sending email when running workflow. The problem is, I need to pass parameter to free marker. I found this link https://forums.alfresco.com/en/viewtopic.php?f=53&t=42238&p=123441. But it doesn't work
Here is my code :


var mail = actions.create("mail");   
mail.parameters.to = "email@gmail.com";
mail.parameters.subject = "New Alfresco workflow submission: ";                      
var templateArgs = new Array();                     
templateArgs['user'] = "workflowId";
var templateModel = new Array();
templateModel['args'] = templateArgs;
mail.parameters.template_model = templateModel;
mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/email_group_document_workflow.ftl");
mail.execute(bpm_package);
</expression>   
..
and my ftl :

<html>
<body>
<p>Hi <strong>${user}</strong>,</p>

……
</body>
</html>
Can anyone help me me with this?

Thank You

Outcomes