Sunday 1 November 2015

Blank Values in Merge Fields HTML template sending mail through Apex code Salesforce!

Hi Folks,

Its been ages since am here. I switched to a new company got busy there. Anyways,,, Lets get started with another requirement and isssue.


Issue:- I was unable to get values in merge fields from the template that I have qurried. 






       
So if we want to use standard email template then we have to use setWhatId to specify the record for which the merge fields should calculate . But the limlitation here is if we have setTargetObjectId which should be Id of  user , contact or a lead. This will not work if we user Id as a setTargetObject Id. It needs to be a contact Id . Otherwise, email which you will receive will have blank value. 

Cheers
Ankush







oAuth Use Case -  Headless API Explained in the Easiest way Wondering why? and When we use the Headless API flow Use case example: Imagine a...