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
Austin MilnerAustin Milner 

Referencing different objects in VF email templates

Hello,
I am wondering if it is possible to cross-reference a different object inside a VisualForce email template, other than what the template was originally set up as. For example, if I create a VF Email template related to the opportunity, I can reference opportunity fields fine. However, if I need to reference something under the Account object, I have been unable to find a way to do so. Is this possible?

More information:
relatedToType="Opportunity"

{!relatedTo.OpportunityField__c} = works
{!Account.ebp_account_name__c} = does not work
Any help or insight would be appreciated greatly!
Best Answer chosen by Austin Milner
Karan Khanna 6Karan Khanna 6
Hi Austin - try this:

{!relatedTo.Account.ebp_account_name__c}

if still don't work, promote below idea :)

https://success.salesforce.com/ideaview?id=08730000000Brk7AAC


All Answers

Karan Khanna 6Karan Khanna 6
Hi Austin - try this:

{!relatedTo.Account.ebp_account_name__c}

if still don't work, promote below idea :)

https://success.salesforce.com/ideaview?id=08730000000Brk7AAC


This was selected as the best answer
Austin MilnerAustin Milner
Thanks Karan, that seemed to work!