cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger email in document workflow

gautami
Champ in-the-making
Champ in-the-making
Hi,

In document library, I am using Review/Approve workflow from Document Actions.

Whenever this workflow is started, I need an email alert to be triggered to Assignee, how to achieve this?

Thanks,
Gautami
3 REPLIES 3

bchevallereau
Champ in-the-making
Champ in-the-making
Hi,

You can update the workflow review and approve to add this action :
webapps/alfresco/WEB-INF/classes/alfresco/workflow/review_processdefinition.xml

Ben

gautami
Champ in-the-making
Champ in-the-making
Thank you for the response.

I'm using Alfresco share. I've tried tweaking webapps/alfresco/WEB-INF/classes/alfresco/workflow/review_processdefinition.xml without any success. Can you provide the steps and code samples if possible?

Thanks,
Gautami

bchevallereau
Champ in-the-making
Champ in-the-making
Hi,

Here is an example of JS code to execute to send an email :

// create mail action
var mail = actions.create("mail");

// set the required parameters
mail.parameters.to = "davidc@alfresco.com";
mail.parameters.subject = "Hello from JavaScript";
mail.parameters.from = "davidc@alfresco.com";
mail.parameters.template = root.childByNamePath("Company Home
  /Data Dictionary/Email Templates/notify_user_email.ftl");
mail.parameters.text = "some text, in case template is not found";

// execute action against a document   
mail.execute(doc);

Here, it's a very interesting for you to execute script during the workflow… And the example is done about how to send an email :
http://wiki.alfresco.com/wiki/WorkflowAdministration#Actions_.26_Scripting

This link can be useful too:
http://wiki.alfresco.com/wiki/Workflow_JavaScript_API