function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Opportunity Field in Plain Text Email Template

I have a button on opportunities to send an email to the primary contact role for that opportunity. I'm trying to add the Opportunity Description to that email.

This works:
<messaging:emailTemplate subject="Your recent order" recipientType="Contact" replyTo="" relatedToType="Opportunity">
<messaging:plainTextEmailBody >
Hi {!Recipient.Firstname} -

Last year around this time you ordered XXX from us at Our Company. Is it time to do that again?

Please let me know if I can help you with anything. Thanks!


But I have to manually replace XXX with the opportunity description. Adding {!Opportunity.Description} to the template gives me this error:

Error: Unknown property ''

How can I include this Descriiption in an email? 
Best Answer chosen by bigga
Thats the issue! The p3_lkid should be {!Opportunity.Id} instead of {!Account.Id} .

All Answers

You should use {!relatedTo.Description} instead of {!Opportunity.Description}
Thanks tons for the reply. While {!relatedTo.Description} doesn't show an error, when it's used, nothing is returned in that space. 

Do I need to specify the Opportunity Description more clearly somehow? 
Does the user sending the email have read access to that field?
In my org, I'm the only user, and I'm the admin. So I'm assuming that I have access to that field since I can edit it on the Opportunity page. 
How does your button work? If you use the normal send email button from the opportunity and the select the template? does it work? I just tried it in my test org and its working fine using {!RelatedTo.Description}
I implemented this button when I first started in SF in 2011 - the button executes a javascript that loads the template, which populates the correct fields: To, From, Reply-To, Subject, and the message body all come from from the email template. 

Here's the JS of the button

Thats the issue! The p3_lkid should be {!Opportunity.Id} instead of {!Account.Id} .
This was selected as the best answer
You're a genius Elie. Problem solved. Thanks for the help fixing this up today.
No problem! Please don't forget to mark my solution as the best one!