Task Link in Email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2009 08:41 AM
I have to send an email to task assignee on creation of task.
I have included the following code which works find and sends the mail:
var mail = actions.create("mail"); mail.parameters.to = bpm_assignee.properties.email; mail.parameters.subject = "Test Document Task " + bpm_workflowDescription; mail.parameters.from = initiator.properties.email; mail.parameters.text = "You have a TASK " ; mail.execute(bpm_package);
My requirement is to include the task link in the mail body, so that when user clicks on that link, after login, user should be navigated to that task straight away.
User should not click on My Alfresco and then search for the task.
Could you please help me in getting the link straight to task.
Thanks and Regards
Preeti Gupta
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2009 04:27 AM
there is some link in the "mytaskspanel.get.html.ftl" (for "My Tasks" dashboard) that gives the URL to manage a selected task.
Have a look at it
<a href="#" onclick="event.cancelBubble=true; openWindowCallback('${url.context}/command/ui/managetask?id=${pooled.id}&type=${pooled.qnameType}&container=plain', MyTasks.manageTaskCallback);">
You can dig a little around this command processor "managetask" to find away to put the URL you need in the mail body
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2009 08:14 AM
Thanks in advance
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2009 03:03 AM
I am using a template,but there am getting the error
Failed to send email to [me]
org.springframework.mail.MailPreparationException: Could not prepare mail; nested exception is org.alfresco.service.cmr.repository.TemplateException: 09200004 Error during processing of the template 'Expression url is undefined on line 12, column 23 in workspace://SpacesStore/07f7676f-b933-4191-bdb7-0fcf8ce32919.
How can i define url for task to get direct link inside alfresco gui?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2009 04:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2009 10:22 AM
Could you please elaborate more when you say
fork the java class.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2009 11:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2009 02:04 AM
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
{
var mail = actions.create("mail");
mail.parameters.to = bpm_assignee.properties.email;
mail.parameters.subject = " You have new document to approve ";
mail.parameters.from = initiator.properties.email;
mail.parameters.text =" Access to document is under My Task To Do \n\n ";
mail.parameters.text +="Access to document: http://servername:8080/alfresco/faces/jsp/login.jsp";
//here i want change login.jsp to show direct link to document and attached metadata
<!– mail.parameters.text +="Access to document: http://servername:8080/alfresco/${bpm_package.children.url} ";
–>
<!– mail.parameters.text += document.url;–>
mail.execute(bpm_package);
}
</script>
</action>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2009 03:25 AM
And your script too : you have to specify a mail template, instead of a text content, so that you'll be able to use variables.
Here is the part of the code where the mail template is used :
// See if an email template has been specified String text = null; NodeRef templateRef = (NodeRef)ruleAction.getParameterValue(PARAM_TEMPLATE); if (templateRef != null) { // build the email template model Map<String, Object> model = createEmailTemplateModel(actionedUponNodeRef); // process the template against the model text = templateService.processTemplate("freemarker", templateRef.toString(), model); }
The "model" variable is a Map of <key, value>.
In your case, you'd like to have the {servername} key, like :
Access to document is under My Task To Do \n\n
Access to document: http://{servername}:8080/alfresco/faces/jsp/login.jsp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2010 03:40 AM
Thanks in advance!!!