You need to sign in to do that
Don't have an account?

Email Template. How to insert dynamic data into email message ?
Hello, Sirs.
I have such Email template:
Dear {!Contact.FirstName},
Secret code is - {!??????????}
I must insert into email message my specific text message ( instead ???????? ).
Apex Code:
//AcID - Contact ID
//Eml - Email Template ID
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setReplyTo('support@force.com');
mail.setSenderDisplayName('Salesforce Support');
mail.setTargetObjectId(AcId);
mail.setTemplateId(EmlId);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
Which way I can do it ?
Thank you.
http://wiki.apexdevnet.com/index.php/Force_Platform_Developer_Guide
All Answers
http://wiki.apexdevnet.com/index.php/Force_Platform_Developer_Guide
Ryan - Must one use a VisualForce email template to merge data from a custom object? It seems like this should be feasible with a regular HTML template and some Apex code too, but I can't find documentation on it anywhere... Any suggestions? Perhaps I should just get on with it and use a VisualForce Template.
Thanks,
Emily