cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow mail template

isloat
Champ in-the-making
Champ in-the-making
Hi,
I have an advanced workflow with this mail action:

<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
    <script>
        var actor = people.getPerson(taskInstance.actorId);
   if (initiator.properties.email != "") {
       if (actor.properties.email != "") {
           var mail = actions.create("mail");
           mail.parameters.to = actor.properties.email;
      mail.parameters.subject = bpm_workflowDescription;
      mail.parameters.from = initiator.properties.email;
      mail.parameters.text = workflowComment+"\n http://192.168.1.10:8080/share/page/user/" + actor.properties.userName + "/dashboard";
      mail.execute(bpm_package);
            }
        }
    </script>
</action>

The variables are:
workflowComment, actor, initiator and bpm_workflowDescription.

How can I externalize this in a template?

I've tried to use:
mail.parameters.template = companyhome.childByNamePath("Data Dictionary/…../test_alfresco_email.ftl");
But how can I send this variables to the template? And is there any way to internationalize the template (test_alfresco_email_es.ftl) ?
I'm using Alfresco 3.4d

Thanks!
2 REPLIES 2

checco
Champ in-the-making
Champ in-the-making
Hi,
I would to do the same thing, did you find a solution?

Thanks
Francesco.

checco
Champ in-the-making
Champ in-the-making
I got it!
you have to set also the mail.parameters.template_model properties.


mail.parameters.template_model = {"initiator":initiator.properties.userName};

and in freemarker template you can write

Hi ${initiator},


Francesco