Skip to content

Commit

Permalink
#13390 cherry-pick the email fix (#13484)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilvam authored Jan 23, 2018
1 parent fb79dd7 commit e61fc6c
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class WorkflowEmailUtil {
* This method will take an email address and a {@link WorkflowProcessor}
* and send a generic workflow email to them. If subject is null, it will be
* intelligently inferred, and if the email text is null, the system will
* try send the file: "static/workflow/workflow_email_template.html".
* try send the file: "static/workflow/workflow_email_template.vtl".
*
* Both the subject and the emailBody will be parsed by Velocity with an
* $workflow object in their context This object is the
Expand Down Expand Up @@ -108,7 +108,7 @@ public static void sendWorkflowEmail(WorkflowProcessor processor, String[] email


if (!UtilMethods.isSet(emailText)) {
emailText = VelocityUtil.mergeTemplate("static/workflow/workflow_email_template.html", ctx);
emailText = VelocityUtil.mergeTemplate("static/workflow/workflow_email_template.vtl", ctx);
isHTML = true;
} else {
emailText = VelocityUtil.eval(emailText, ctx);
Expand Down Expand Up @@ -138,7 +138,7 @@ public static void sendWorkflowEmail(WorkflowProcessor processor, String[] email
* to a group of people that belong to the next assign role. If subject is
* null, it will be intelligently inferred, and if the email text is null,
* the system will try send the file:
* "static/workflow/workflow_email_template.html". Both the subject and the
* "static/workflow/workflow_email_template.vtl". Both the subject and the
* emailBody will be parsed by Velocity with an $workflow object in their
* context This object is the {@link WorkflowProcessor} object that has
* access to every aspect of the workflow task.
Expand Down Expand Up @@ -186,7 +186,7 @@ public static void sendWorkflowMessageToNextAssign(WorkflowProcessor processor,

} catch (Exception e) {

throw new DotWorkflowException("Exception ocurred trying to deliver emails for workflow " + e.getMessage());
throw new DotWorkflowException("Exception ocurred trying to deliver emails for workflow " + e.getMessage(), e);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title></title>
</head>
<body bgcolor="#EBE8DA">



<table cellpadding="0" cellspacing="0" border="0" width="660" bgcolor="#FFFFFF">
<tr>
<td align="right" colspan='3'>
<img src="http://$host.hostname/image/company_logo?img_id=dotcms.org&key=901050" width='200'/>
</td>
</tr>

</table>


<table cellpadding="5" cellspacing="1" border="0" width="660" bgcolor="#eeeeee">
<tr>
<td valign="top" colspan="2">
<b>$languagewebapi.getFromUserLanguage("dotCMS-Workflow")</b>
#if($nextStepResolved)
($languagewebapi.getFromUserLanguage("Resolved")!)
#end
</td>
</tr>
<tr bgcolor="white">
<td align="right" valign="top">
<font color="gray"><b>$structureName:</b></font>
</td>
<td>
<a href="${workflowLink}">$!{workflowTaskTitle}</a><br>
</td>
</tr>
<tr bgcolor="white">
<td align="right">
<font color="gray"><b>$languagewebapi.getFromUserLanguage("Updated-By"):</b></font>
</td>
<td>
$!{user.fullName} @ $!{UtilMethods.dateToHTMLDate($modDate, "MM/dd/yyyy hh:mm:ss a")}

</td>
</tr>
#if($stepId != $nextStepId)
<tr bgcolor="white">
<td align="right">
<font color="gray"><b>$languagewebapi.getFromUserLanguage("Moved-from"):</b></font>
</td>
<td>

$!{stepName} --> $!{nextStepName}

</td>
</tr>
#else
<tr bgcolor="white">
<td align="right">
<font color="gray"><b>$languagewebapi.getFromUserLanguage("Current-Step"):</b></font>
</td>
<td>
$!{step}
</td>
</tr>
#end

<tr bgcolor="white">
<td align="right">
<font color="gray"><b>$languagewebapi.getFromUserLanguage("Assignee"):</b></font>
</td>
<td>
$!{nextAssign}
</td>
</tr>

#if($UtilMethods.isSet($workflowMessage))


<tr bgcolor="white">
<td align="right">
<font color="gray"><b>$languagewebapi.getFromUserLanguage("Comment"):</b></font>
</td>
<td>
<em>$workflowMessage</em>
</td>
</tr>
#end
</table>


</body>
</html>

0 comments on commit e61fc6c

Please sign in to comment.