You need to sign in to do that
Don't have an account?
vanessen
email template use from apex code
I am sending an email from apex using an email template.I can specify the object to use by my email template for the recipientType (by using the setTargetobjectId method) but how can i specifty the object to be used by my emailTemplate for the relatedTo
my code is the following:
if (!templateList.isEmpty() && userIds.contains(caseMap.get(t1.WhatId).OwnerId)){
//there is a template to be used
mail.setTargetObjectId(caseMap.get(t1.WhatId).OwnerId);
mail.setSaveAsActivity(false);
mail.setWhatId(caseMap.get(t1.WhatId).Id);
mail.setTemplateId(templateList[0].Id);
}
'setWhatId' refer to the relatedto.There is no method in single email and mass email messages for the relatedTo.
Hope this helps.
All Answers
'setWhatId' refer to the relatedto.There is no method in single email and mass email messages for the relatedTo.
Hope this helps.
thank you very much, problem solved