You need to sign in to do that
Don't have an account?
JBabu
Need help on Email Templates question
hi
I have created a new Email Template of type Custom or Visualforce or Text.
The following case has been assigned to you.
Company: {!Account.Name}
Contact Name: {!Contact.Name}
Case #: {!Case.CaseNumber}
Subject: {!Case.Subject}
Description: {!Case.Description}
Company: {!Account.Name}
Contact Name: {!Contact.Name}
Case #: {!Case.CaseNumber}
Subject: {!Case.Subject}
Description: {!Case.Description}
I have written an apex class for calling this email template and sending an email.
I am sending an email to the User.
But i dont know how to pass values to Merge fields (mentioned above) in that email template from an apex class.
How can I pass values to merge fields in Email template? Please help me out.
Thanks,
JBabu.
Try this
mail.setTargetObjectId(con.Id); // con.id is the ID of the record that u want to us in email tamplate
// for ex if i want to send email on my account test whos id is 00142GHBSH453EO
then i write mail.setTargetObjectId('00142GHBSH453EO');
mail.setTemplateId('00X90000000QHUD'); // U r email tamplate
All Answers
Try this
mail.setTargetObjectId(con.Id); // con.id is the ID of the record that u want to us in email tamplate
// for ex if i want to send email on my account test whos id is 00142GHBSH453EO
then i write mail.setTargetObjectId('00142GHBSH453EO');
mail.setTemplateId('00X90000000QHUD'); // U r email tamplate
Thank you SRK.
Welcome friend :)