cancel
Showing results for 
Search instead for 
Did you mean: 

Sending email notification in work flow

srik
Champ in-the-making
Champ in-the-making
HI Team ,

Currently i am working on sending the email from  work flow to specific groups , but i get few errors doing it.

following is my bpmn diagram.
class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
      
var mail = actions.create("mail");
var candidateGroupName = "GROUP_AZ RRD Client Services";
var candidateGroup = new Array(candidateGroupName);                
mail.parameters.to_many=candidateGroup;
mail.parameters.subject = "Adhoc Task " ;
mail.parameters.from = initiator.properties.email;
mail.parameters.text = "It's done";
mail.execute(document)



.

it says the document not defined error.the  email notification doesn't works

can any one please suggest me about the problem .

Thanks
Srikanth S
1 REPLY 1

lementree
Champ on-the-rise
Champ on-the-rise
Hi,

You can not access document in Workflow script. to send mail just pass null instead of document.
i.e

var mail = actions.create("mail");
var candidateGroupName = "GROUP_AZ RRD Client Services";
var candidateGroup = new Array(candidateGroupName);
mail.parameters.to_many=candidateGroup;
mail.parameters.subject = "Adhoc Task " ;
mail.parameters.from = initiator.properties.email;
mail.parameters.text = "It's done";
mail.execute(null)//here if you want you can use companyhome in place of null