4

enter code hereI have created visualforce email template for Task Object. Email pops up to the respective user Id when sent through 'Send test and verify merge fields' with content specified in template. And when the same vf email template when called from workflow for Task email pops up but with empty content. Please guide me. Thanks

The code below is the Visualforce email template created.On creating workflow for Task object with email alert,email gets popped up but with no content.

<messaging:emailTemplate subject="AOO" 
                         recipientType="User" 
                        relatedToType="Contact">
<messaging:htmlEmailBody >
<html>
<body>
<style>
hr {
   display: block;
   margin-top: 0.5em;
   margin-bottom: 0.5em;
   margin-left: auto;
   margin-right: auto;
   border-style: inset;
   border-width: 1px;
   border-color: blue;
}
table {
    font-family: Times New Roman, sans-serif;
    border-collapse: collapse;
    width: 75%;
}
td, th {
   border-bottom: 1px solid #ddd;
    text-align: left;
    padding: 8px;
}
</style>
<table>
<apex:repeat var="vt" value="{!relatedTo.Tasks}">
<tr>
    <td><b>AssignedTo</b></td>
    <td>{!vt.Owner.name}</td>
    <td><b>Status</b></td>
    <td>{!vt.Status}</td>
</tr>
<tr>
    <td><b>Subject</b></td>
    <td>'{!vt.Subject}'</td>
    <td><b>Name</b></td>
    <td>'{!vt.who.Name}'</td>
</tr>
  <tr>
    <td><b>Due date</b></td>
    <td>{!vt.ActivityDate}</td>
    <td><b>RelatedTo</b></td>
    <td>{!vt.What.Name}</td>
  </tr>
  <tr>
<td><b>Phone</b></td>
    <td>9066846020</td>
   <td><b>Email</b></td>
    <td>chandanakk1995@gmail.com</td>
  </tr>
  <tr>
    <td><b>CreatedBy</b></td>
    <td>{!vt.CreatedBy.Name}</td>
    <td><b>Last ModifiedBy</b></td>
    <td>{!vt.LastModifiedBy.Name}</td>
  </tr>
  <tr>
    <td><b>Comments</b></td>
    <td>{!vt.Description}</td>
    </tr>
</apex:repeat>
</table>
<table>
<apex:repeat var="bt" value="{!relatedTo.Tasks}">
<tr>
<td>
Remainder <input type="checkbox" name="Remainder" /></td>
<td>{!bt.IsReminderSet}</td>
</tr>
</apex:repeat>
</table>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
  • Does the template refer to a VF component? If yes, check whether the user profile has access to that component. – Sagnik Chattopadhyay Jan 2 '18 at 10:24
  • Thank you Sagnik. Currently I'm the Admin of this org. , so i have access to every components. – jayasuriya janarthan Jan 2 '18 at 10:55
  • Reduce the size of the problem space to the smallest possible email template; then edit your question with details – cropredy Jan 2 '18 at 23:40
1

There is a known issue with VF email templates and WFR that can cause these kinds of issues, https://success.salesforce.com/issues_view?id=a1p30000000SdBfAAK Recipient bind values are blank. The work around is either get all the data you need from the RelatedTo value or else use a trigger instead of WFR.

0

I have using the same kind of functionality where I am sending it as a PDF. Please check that your VF has component has all the values.

<apex:page docType="html-5.0" action="{!yourApexMethod}" controller="ApexCustomController" > <!-- your VF page --> </apex:page>

yourApexMethod will run when the vf page is called and creates the necessary data which is you want it to be displayed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.