cancel
Showing results for 
Search instead for 
Did you mean: 

Localizing email notification in workflow javascript

robinflow
Champ in-the-making
Champ in-the-making
Hi all!
I'm sending an email notification at each transition of the workflow, and I was wondering wether it's possible to localize the header and the content of the email. I'm using the sample javascript found on the WorkflowAdmin wiki page:

           var mail = actions.create("mail");
           mail.parameters.to = initiator.properties["cm:email"];
           mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
           mail.parameters.from = bpm_assignee.properties["cm:email"];
           mail.parameters.text = "It's done";
           mail.execute(bpm_package);

So let's say I'd like to change the text: "It's done" to something else; what is the way to turn it into a variable associated with a message in the properties file? In other words: how would I need to change this line, and besides adding it to the custom-messages.properties file, what else is there to do, to make it work?
1 REPLY 1

sbuckle
Champ in-the-making
Champ in-the-making
You could set the body of the email to use a Freemarker template and then use the message(String) function in the template to localize any strings:


mail.parameters.template = root.childByNamePath("Company Home/Data Dictionary/Email Templates/your_email_template.ftl");