AnsweredAssumed Answered

Workflow mail template

Question asked by isloat on Nov 16, 2011
Latest reply on Jun 28, 2012 by checco
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!

Outcomes