I am facing issues while developing Visualforce email template. I am unable to add VF components in the Visualforce email template. Looks everthing good to me, but not sure why VF Component not loading ?
AccountTemplate
public class AccountTemplate {
public Id accountId {get;set;}
public List<Opportunity> getopptys(){
List<Opportunity> oppList = [SELECT Name, StageName,CloseDate FROM Opportunity WHERE Accountid =: accountId];
return oppList;
}
}
AccountTemplateVFComponent
<apex:component controller="AccountTemplate" access="global">
<apex:attribute name="AcctId" type="Id" description="Id of the Account" assignTo="{!accountId}" >
<table border="1" cellspacing="5">
<tr>
<td>Opportunity Name</td>
<td>Opportunity Stage</td>
<td>Close Date</td>
</tr>
<apex:repeat value="{!opptys}" var="o">
<tr>
<td>{!o.Name}</td>
<td>{!o.StageName}</td>
<td>{!o.CloseDate}</td>
</tr>
</apex:repeat>
</table>
</apex:attribute>
</apex:component>
I dont see table in the Preview, what is the issue ?
Send test and verify merge field
to verify your template.