cancel
Showing results for 
Search instead for 
Did you mean: 

Send email in create listener of multi instance email.

mstein
Champ in-the-making
Champ in-the-making
Hi All,

I have a workflow with a multi-instance task and I want to email the assignee on create. I have some code that looks like this:

<userTask id="alfrescoUsertask1" name="Review Task" activiti:assignee="${reviewAssignee.properties.userName}" activiti:formKey="wf:activitiReviewTask">
      <extensionElements>
        <activiti:taskListener event="create" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
          <activiti:field name="script">
            <activiti:string>logger.log("review task for:" + reviewAssignee.properties.userName);
var mail = actions.create("mail");
mail.parameters.to = reviewAssignee.properties.email;
mail.parameters.subject = "Review Task Assignment: " + bpm_package.children[0].properties.name;
mail.parameters.text = "Review this now!";
mail.execute(bpm_package);</activiti:string>
          </activiti:field>
        </activiti:taskListener>
      </extensionElements>
      <multiInstanceLoopCharacteristics isSequential="false" activiti:collection="bpm_assignees" activiti:elementVariable="reviewAssignee"></multiInstanceLoopCharacteristics>
    </userTask>


For some reason reviewAssignee.properties.email is blank, reviewAssignee.properties.userName works fine and initiator.properties.email is good too.

Any thoughts?

Thanks,
Max
1 REPLY 1

mstein
Champ in-the-making
Champ in-the-making
Duh, I was sending 'Alice Beecher' not abeecher.

Solved.