You need to sign in to do that
Don't have an account?
How to pass value into the merge field in the Email template
I am building a customized send email function with Visualforce page. If user chooses an Email template, in the email body(input text area), the merge field value {!Contact.Name} can’t get the correct data as standard send email function can do. I am not sure if anyone has any solution to solve this problem, I will appreciate it.
What I am trying to do now is to create another temporary email with setTargetObjectId, setWhatId and setTemplateId, send the temporary email out and then use getPlainTextBody to get the temporary email body, in which all merge fields are replaced by the correct data. But the problem is the temporary email already sent out to the contact. So is there any way to re-direct the temporary email sent to a dummy address, not to the contact?
Mike,
I am sorry but I am thoroughly confused about what you are trying to exlpain here!
Can you please elaborate the scenario?
Cool_D
Thanks for your reply. The scenario is I created a visualforce page to send email, just like standard send email page. When user choose a Email Template, there are some merge field like {!Contact.Name} or {!Account.Email} in the Email Template can't be passed correct value like standard Send email function.
So my question is how to pass the value to those merge field in the Visualforce page? Thanks
Cool_D
Hi Michael2009
Did you get any solution for your problem? I'm facing the same issue, so curious about the solution
Thanks
Sachin