You need to sign in to do that
Don't have an account?
b.gonzalez
Error: Unknown property 'core.email.template.EmailTemplateComponentController
When saving my visualforce page email template, I recieve the following Error: Unknown property 'core.email.template.EmailTemplateComponentController.CampaignMember'.
Visualforce Email Template
<messaging:emailTemplate subject="PDR Generated Prospect is Available for Follow-Up PDR: NA - South Central Seek List" recipientType="User" relatedToType="CampaignMember">
<messaging:htmlEmailBody >
<html>
<body>
<STYLE type="text/css">
TH {font-size: 14px; font-face: arial;background: #CCCCCC; border-width: 1; text-align: center }
TD {font-size: 14px; font-face: verdana }
TABLE {border: solid #CCCCCC; border-width: 1}
TR {border: solid #CCCCCC; border-width: 1}
</STYLE>
<font face="arial" size="3"></font>
<p>Dear Salesforce User,</p>
<p>New PDR Generated prospect(s)have been assigned to a your <b>PDR Generated</b> seek list and is now available for follow up in the following <b>Power Dialer</b> seek list:</p>
<p><b>PDR Generated (NA - South Central)</b></p>
<p>To launch the seek list, please click on the following link: <apex:outputLink value="https://na6.salesforce.com/{!CampaignMember.id}">{!CampaignMember.Name}</apex:outputLink></p>
<table border="1"></table>
<tr></tr>
<table border="0" >
<tr >
<th>Prospect First Name</th><th>Prospect Last Name</th><th> Title </th><th> Phone </th><th> Email </th><th> State </th><th> Country </th><th>Company Name</th><th> Marketing Source</th>
</tr>
<apex:repeat var="cm" value="{!relatedTo.CampaignMember}">
<tr>
<td>{!cm.FirstName}</td>
<td>{!cm.LastName}</td>
<td>{!cm.Title}</td>
<td>{!cm.Phone}</td>
<td>{!cm.Email}</td>
<td>{!cm.State}</td>
<td>{!cm.Country}</td>
<td>{!cm.CompanyOrAccount}</td>
<td>{!cm.Campaign}</td>
</tr>
</apex:repeat>
</table>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
Visualforce Email Template
<messaging:emailTemplate subject="PDR Generated Prospect is Available for Follow-Up PDR: NA - South Central Seek List" recipientType="User" relatedToType="CampaignMember">
<messaging:htmlEmailBody >
<html>
<body>
<STYLE type="text/css">
TH {font-size: 14px; font-face: arial;background: #CCCCCC; border-width: 1; text-align: center }
TD {font-size: 14px; font-face: verdana }
TABLE {border: solid #CCCCCC; border-width: 1}
TR {border: solid #CCCCCC; border-width: 1}
</STYLE>
<font face="arial" size="3"></font>
<p>Dear Salesforce User,</p>
<p>New PDR Generated prospect(s)have been assigned to a your <b>PDR Generated</b> seek list and is now available for follow up in the following <b>Power Dialer</b> seek list:</p>
<p><b>PDR Generated (NA - South Central)</b></p>
<p>To launch the seek list, please click on the following link: <apex:outputLink value="https://na6.salesforce.com/{!CampaignMember.id}">{!CampaignMember.Name}</apex:outputLink></p>
<table border="1"></table>
<tr></tr>
<table border="0" >
<tr >
<th>Prospect First Name</th><th>Prospect Last Name</th><th> Title </th><th> Phone </th><th> Email </th><th> State </th><th> Country </th><th>Company Name</th><th> Marketing Source</th>
</tr>
<apex:repeat var="cm" value="{!relatedTo.CampaignMember}">
<tr>
<td>{!cm.FirstName}</td>
<td>{!cm.LastName}</td>
<td>{!cm.Title}</td>
<td>{!cm.Phone}</td>
<td>{!cm.Email}</td>
<td>{!cm.State}</td>
<td>{!cm.Country}</td>
<td>{!cm.CompanyOrAccount}</td>
<td>{!cm.Campaign}</td>
</tr>
</apex:repeat>
</table>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
All Answers
<apex:repeat var="cm" value="{!relatedTo.CampaignMember}">
<tr>
<td>{!cm.FirstName}</td>
<td>{!cm.LastName}</td>
<td>{!cm.Title}</td>
<td>{!cm.Phone}</td>
<td>{!cm.Email}</td>
<td>{!cm.State}</td>
<td>{!cm.Country}</td>
<td>{!cm.CompanyOrAccount}</td>
<td>{!cm.Campaign}</td>
</tr>
</apex:repeat>
Make the repeat {!relatedTo.campaignMembers} should work.
Shote the repeat be: <apex:repeat value="{!relatedTo.CampaignMember}">?
I am still recieving the same error.
See changes in bold.
<messaging:emailTemplate subject="PDR Generated Prospect is Available for Follow-Up PDR: NA - South Central Seek List" recipientType="User" relatedToType="Campaign">
<messaging:htmlEmailBody >
<html>
<body>
<STYLE type="text/css">
TH {font-size: 14px; font-face: arial;background: #CCCCCC; border-width: 1; text-align: center }
TD {font-size: 14px; font-face: verdana }
TABLE {border: solid #CCCCCC; border-width: 1}
TR {border: solid #CCCCCC; border-width: 1}
</STYLE>
<font face="arial" size="3"></font>
<p>Dear Salesforce User,</p>
<p>New PDR Generated prospect(s)have been assigned to a your <b>PDR Generated</b> seek list and is now available for follow up in the following <b>Power Dialer</b> seek list:</p>
<p><b>PDR Generated (NA - South Central)</b></p>
<p>To launch the seek list, please click on the following link: <apex:outputLink value="https://na6.salesforce.com/{!relatedTo.id}">{!relatedTo.Name}</apex:outputLink></p>
<table border="1"></table>
<tr></tr>
<table border="0" >
<tr >
<th>Prospect First Name</th><th>Prospect Last Name</th><th> Title </th><th> Phone </th><th> Email </th><th> State </th><th> Country </th><th>Company Name</th><th> Marketing Source</th>
</tr>
<apex:repeat value="{!relatedTo.CampaignMember}">
<tr>
<td>{!relatedTo.FirstName}</td>
<td>{!relatedTo.LastName}</td>
<td>{!relatedTo.Title}</td>
<td>{!relatedTo.Phone}</td>
<td>{!relatedTo.Email}</td>
<td>{!relatedTo.State}</td>
<td>{!relatedTo.Country}</td>
<td>{!relatedTo.CompanyOrAccount}</td>
<td>{!relatedTo.Campaign}</td>
</tr>
</apex:repeat>
</table>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
1) <apex:repeat var = "cm" value="{!relatedTo.CampaignMembers}">
<tr>
<td>{!cm.relatedTo.FirstName}</td>
<td>{!cm.relatedTo.LastName}</td>
<td>{!cm.relatedTo.Title}</td>
<td>{!cm.relatedTo.Phone}</td>
<td>{!cm.relatedTo.Email}</td>
<td>{!cm.relatedTo.State}</td>
<td>{!cm.relatedTo.Country}</td>
<td>{!cm.relatedTo.CompanyOrAccount}</td>
<td>{!cm.relatedTo.Campaign}</td>
</tr>
</apex:repeat>
2) <apex:repeat var = "cm" value="{!relatedTo.CampaignMembers}">
<tr>
<td>{!cm.FirstName}</td>
<td>{!cm.LastName}</td>
<td>{!cm.Title}</td>
<td>{!cm.Phone}</td>
<td>{!cm.Email}</td>
<td>{!cm.State}</td>
<td>{!cm.Country}</td>
<td>{!cm.CompanyOrAccount}</td>
<td>{!cm.Campaign}</td>
</tr>
</apex:repeat>
3)<apex:repeat var = "cm" value="{!relatedTo.CampaignMembers}">
<tr>
<td>{!relatedTo.FirstName}</td>
<td>{!relatedTo.LastName}</td>
<td>{!relatedTo.Title}</td>
<td>{!relatedTo.Phone}</td>
<td>{!relatedTo.Email}</td>
<td>{!relatedTo.State}</td>
<td>{!relatedTo.Country}</td>
<td>{!relatedTo.CompanyOrAccount}</td>
<td>{!relatedTo.Campaign}</td>
</tr>
March 25, 2014 · Like0 · Dislike0 · FlagBest Answer
{!IF(cm.contactId != null,cm.contact.FirstName,cm.lead.firstname)}
<messaging:emailTemplate subject="PDR Generated Prospect is Available for Follow-Up PDR: NA - South Central Seek List" recipientType="User" relatedToType="Campaign">
<messaging:htmlEmailBody >
<html>
<body>
<STYLE type="text/css">
TH {font-size: 14px; font-face: arial;background: #CCCCCC; border-width: 1; text-align: center }
TD {font-size: 14px; font-face: verdana }
TABLE {border: solid #CCCCCC; border-width: 1}
TR {border: solid #CCCCCC; border-width: 1}
</STYLE>
<font face="arial" size="3"></font>
<p>Dear Salesforce User,</p>
<p>New PDR Generated prospect(s)have been assigned to a your <b>PDR Generated</b> seek list and is now available for follow up in the following <b>Power Dialer</b> seek list:</p>
<p><b>PDR Generated (NA - South Central)</b></p>
<p>To launch the seek list, please click on the following link: <apex:outputLink value="https://na6.salesforce.com/{!relatedTo.id}">{!relatedTo.Name}</apex:outputLink></p>
<table border="1"></table>
<tr></tr>
<table border="0" >
<tr >
<th>Prospect First Name</th><th>Prospect Last Name</th><th> Title </th><th> Phone </th><th> Email </th><th> State </th><th> Country </th><th>Company Name</th><th> Marketing Source</th>
</tr>
<apex:repeat var = "cm" value="{!relatedTo.CampaignMembers}">
<tr>
<td>{!IF(cm.contactId != null,cm.contact.FirstName,cm.lead.firstname)}</td>
<td>{!cm.LastName}</td>
<td>{!cm.Title}</td>
<td>{!cm.Phone}</td>
<td>{!cm.Email}</td>
<td>{!cm.State}</td>
<td>{!cm.Country}</td>
<td>{!cm.CompanyOrAccount}</td>
<td>{!cm.Campaign}</td>
</tr>
</apex:repeat>
</table>
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>
The final version of that section is:
<apex:repeat var="cm" value="{!relatedTo.CampaignMembers}">
<tr>
<td>{!IF(cm.contactId != null,cm.contact.FirstName,cm.lead.firstname)}</td>
<td>{!IF(cm.contactId != null,cm.contact.LastName,cm.lead.lastname)}</td>
<td>{!IF(cm.contactId != null,cm.contact.Title,cm.lead.Title)}</td>
<td>{!IF(cm.contactId != null,cm.contact.Phone,cm.lead.Phone)}</td>
<td>{!IF(cm.contactId != null,cm.contact.Email,cm.lead.Email)}</td>
<td>{!IF(cm.contactId != null,cm.contact.MailingState,cm.lead.State)}</td>
<td>{!IF(cm.contactId != null,cm.contact.MailingCountry,cm.lead.Country)}</td>
<td>{!IF(cm.contactId != null,cm.contact.Account,cm.lead.Company)}</td>
<td>{!cm.Campaign}</td>
</tr>
</apex:repeat>