Home > Blog > Send a Dynamic Email Template through Apex code in Salesforce

Send a Dynamic Email Template through Apex code in Salesforce

Hi Friends, Here, I am showing you how to send a dynamic Email template through Apex Class or trigger from custom object step by step. There are so many difficulties comes, When will send template through Apex class in Salesforce. But this is very easy code, Please follow step by step process. So here I am using a custom object, one Standard object(Lead) , one Email Template, Trigger And Handler class. Step 1: Create a Custom object. Object Name –    Candidate Custom Fields –  Email (Email), Status (Picklist), Updated Date (Date) . Standard Fields – Name (Text), Step 2: Add Candidate object and Leads  in Tab. Step 3: Create custom fields at Candidate Object. Step 4: Create a Email Template named as – send to candidate template (Text). Step 5: Write a trigger on Candidate custom object. Which will fire After Update Event. Step 6: Write a Apex class and call static method. /** ( Link of code reference is given below ) **/ Step 7: Create a record on Candidate object. And update it. Then you will receive a dynamic mail. Step 8: Thank You.                                                                                                                                                                         SAZID ALI Code References: http://prntscr.com/iri2h7 http://prntscr.com/iri2r9    
Enquire Now

lets get over a cup of coffee and discuss!

Page Name: