Alan
Alan

Reputation: 526

Alfresco: Modifying email link

I have deployed a custom workflow, and have email notifications correctly setup for each task. The email links currently look like the following:

https://myCompany.com/share/page/task-details?taskId=activiti$58788

This link takes the user to the details view of the task, and requires them to hit the "Edit" button at the bottom to actually perform the task. Ideally, I would like to change the link to the following:

https://myCompany.com/share/page/task-edit?taskId=activiti$58788

As task-edit allows them to immediately edit the form and perform the task. How might I go about making this change (for just this workflow)?

Upvotes: 0

Views: 1172

Answers (1)

Tahir Malik
Tahir Malik

Reputation: 6643

To change the email template(s) for all notifications: wf-email.html.ftl located in Data dictionary/Email templates/Workflow notification

Change the following html snippet:

<a href="${shareUrl}/page/task-details?taskId=${args.workflowId}">${shareUrl}/page/task-details?taskId=${args.workflowId}</a>

Into

<a href="${shareUrl}/page/task-edit?taskId=${args.workflowId}">${shareUrl}/page/task-edit?taskId=${args.workflowId}</a>

If you're using your own notification mechanism, then create a new email template based on this one and use the path in your Mail task or JavaScript mail action.

---UPDATE---

You can use this JavaScript in you're workflow to send an email, still it's easier to use the AlfrescoMailtask.

// create mail action

var mail = actions.create("mail");
mail.parameters.to = "[email protected]";
mail.parameters.subject = "You've got mail";
mail.parameters.from = "[email protected]";
mail.parameters.template = companyhome.childByNamePath("Data Dictionary/Email Templates/Workflow notification/My_custom_Template.ftl");
mail.parameters.text = "some text, in case template is not found";

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

Upvotes: 1

Related Questions