+ Start a Discussion
Jerun JoseJerun Jose 

Mail to Opportunity owner and sales team using templates



I have a requirement where I need to send an email to the Opportunity owner and some sales team members (defined by the team role).


Is it possible to use an email template while doing this? I was able to do something similar using a workflow email alert, but this time, I need to send the email through Apex.


Any help is appreciated.




Jerun Jose

Jerun JoseJerun Jose

Thanks for the reply, but all the posts seem to indicate that the TargetObjectID can only be set to one user, contact or lead.


Even if I set the targetObjectID to the opportunity owner, how do I add the sales team users to the recepient list?


You can make a query to the sales team  based on opportunity id/contactid/accountid and pass the userid to targetObjectID 


Mark it as resolved if it helps you.