You need to sign in to do that
Don't have an account?
IvanWu
How to send Email with email template in apex
Hello everyone ,
I created a email template ,in this email template ,i set some merge fields ,they are reference from two object
what i want to do is using this emai template to send email via apex ,i have tried the SingleEmailMessage class and i know i can set the value of merge field throughout the whatid ,
the problem is that i can only set the whatid with only one vlaue ,this means the merge fields in email template can only receive the value from one object,which will cause some merge fields without values
so ,can anybody help me to resolve this problem? anys sugguestions would be appreciate, thanks.
I created a email template ,in this email template ,i set some merge fields ,they are reference from two object
what i want to do is using this emai template to send email via apex ,i have tried the SingleEmailMessage class and i know i can set the value of merge field throughout the whatid ,
the problem is that i can only set the whatid with only one vlaue ,this means the merge fields in email template can only receive the value from one object,which will cause some merge fields without values
so ,can anybody help me to resolve this problem? anys sugguestions would be appreciate, thanks.
This may help you.
Create Visualforce email template: Apex Class:
Thanks
Vinod