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
Stuart GrimshawStuart Grimshaw 

What parameter name is the related ID for an email?

I have a component that I call from an email template, the controller for the component is an Apex class that needs to get the ID of the related object so it can look up some data, in the constructor I do this:

public void ShippingHelper() {
        this.quoteId = ApexPages.currentPage().getParameters().get('related_to_id');
    }

When testing the email on the "Visualforce Email Template" page I can select the related object & it renders the email perfectly.

When I send the same email as part of an approval process none of the content from the class is rendered.
Ashish_SFDCAshish_SFDC
Hi Stuart, 


Cross Object Merge Fields in Email Template is not yet available - vote for the idea below, 

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

In API - you have to call the related object record like this, 

{!CurrentObject__r.RelatedObject__c.FieldName__c}


Regards,
Ashish