You need to sign in to do that
Don't have an account?
Unknown property 'core.email.template.EmailTemplateComponentController.Lead' in VF email templates
I am creating a VF email template on Lead that is meant to render a PDF as an attachment, but keep getting the above error. Any ideas would be appreciated! My code is shown below:
<messaging:emailTemplate subject="Provider Application" recipientType="Lead" relatedToType="Lead">
<messaging:plainTextEmailBody >
Dear {!recipient.name},
PLAIN TEXT BODY
</messaging:plainTextEmailBody>
<messaging:attachment renderAs="pdf" filename="{!relatedTo.Company}">
<apex:stylesheet value="{!URLFOR($Resource.pdfresource, 'styles.css')}"/>
<apex:image url="{!$Resource.Logo}"/>
FIELDS TO BE DISPLAYED
</apex:panelGrid>
</body>
</html>
</messaging:attachment>
</messaging:emailTemplate>
Well, I think that I figured out the first problem on save since I was calling fields like this:
{!Lead.Company}, but when I changed them to {!RelatedTo.Company}, I no longer received the error. However, when the PDF renders as part of the email and attaches to the email,all of the fields I referred to with the {!RelatedTo.XXX} are blank. What am I doing wrong here?
Please help - thanks!!!!
I was left with blank fields whenever I selected the email template before selecting the Contact to whom I was sending the email.
Are you manually sending the email with attached PDF from the lead itself? Or is this an automated email?