+ 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.
Hi Stuart, 

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


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