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
Peter Martensen 8Peter Martensen 8 

Can I use data from an Opportunity linked to a custom Object Record on a HTML email template?

I have a custom Object (Market_Intelligence_Reports__c) that has a lookup field to Opportunities.  I would like to use data from the Opportunity in a HTML email template.  I can't use a VF template because I need to use the template in an Activity Email from the Market Intelligence Reports record.  Is there a way to use the Opportunity data in the template?  I've tried things like
{!Market_Intelligence_Reports__c.Opportunity__r.Account.Name}, {!Opportunity__r.Account.Name}, {!Market_Intelligence_Reports__c.Opportunity__r.Account}
ShirishaShirisha (Salesforce Developers) 
Hi Peter,


Cross-Object Email Template is not Possible in salesforce at this point in time It's an idea (, you can also upvote it.

You can't access or use the values of any related object in email templates, you might have to create formula field to bring down the value from parent to the object on which the email template is target.

You can access and display child record details in the email template of a parent is to use Visualforce Email Templates.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Warm Regards,
Shirisha Pathuri
Peter Martensen 8Peter Martensen 8
I discovered that converting the Opportunity Lookup field to a Master-Detail field enabled the template to access the cross Object data.