cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow email notification subject

cgiuliano
Champ in-the-making
Champ in-the-making
Hi everybody!
Does anyone know how to customize the subject in the email notifications sent by Activiti workflows?
It appears as it is fixed into the Java class WorkflowNotificationUtils, with no further options than choosing between pooled and not-pulled workflow related texts.
Any suggestion on how to manage customized email subjects for your own Activiti workflows?

Thanks!
Carlo
4 REPLIES 4

niketapatel
Star Contributor
Star Contributor
For your own custom activity workflow, you can use OOB avaiable mail action in yor task and can have mail subject as per your requirement

Please check OOB workflow - adhoc process defination file.


               
                  <activiti:field name="script">
                     <activiti:string>
                       
                        if (wf_notifyMe)
                     {
                        var mail = actions.create("mail");
                        mail.parameters.to = initiator.properties.email;
                        mail.parameters.subject = "Adhoc Task " + bpm_workflowDescription;
                        mail.parameters.from = bpm_assignee.properties.email;
                        mail.parameters.text = "It's done";
                        mail.execute(bpm_package);
                     }
                    
                    

Hope this helps!

cgiuliano
Champ in-the-making
Champ in-the-making
Thanks a lot for your help, Niketa!

I was wondering if I can use a well-formatted Freemarker template with this action: I would like to use a similar template as the OOB one.
Do you know if that is possible?

Thanks again,
Carlo

niketapatel
Star Contributor
Star Contributor
Yeah, You can do that


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


EDIT: I dont find wiki but you can check this class for all possible parameters and how tht works

org.alfresco.repo.action.executer.MailActionExecuter

Hope that helps!

Thanks Niketa,
that was very helpful!

Carlo