cancel
Showing results for 
Search instead for 
Did you mean: 

Passing Parameter to Freemarker

nunuts
Champ in-the-making
Champ in-the-making
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
10 REPLIES 10

amandaluniz_z
Champ on-the-rise
Champ on-the-rise
Just checked that the template_mode for the mail action is available I think from 4.0.0 onwards (talking about enterprise), 3.4.7 haven't got that feature…