You need to sign in to do that
Don't have an account?
Stuart Grimshaw
Do Visualforce email templates have access to related_to_id or id?
When using an Apex component from within a Visualforce email template, how do I access the Id of the object the email is related to?
In the Apex controller class I've tried using ApexPages.currentPage().getParameters().get('related_to_id') which works when using the "Send test & verify merge fields" button from the template page, but this doesn't work when the email is sent via an Aproval process.
I've also tried using ApexPages.currentPage().getParameters().get('id') which works in neither!
In the Apex controller class I've tried using ApexPages.currentPage().getParameters().get('related_to_id') which works when using the "Send test & verify merge fields" button from the template page, but this doesn't work when the email is sent via an Aproval process.
I've also tried using ApexPages.currentPage().getParameters().get('id') which works in neither!
All Answers
I hope this will help,
{!CurrentObject__r.RelatedObject__c.FieldName__c}
Regards,
Ashish