trigger to send email when record is created -- w3web.net

Apex Trigger to Send a Custom Visualforce Component Email Template when Record is Created on Custom Object in Salesforce

Hey guys, today in this post we are going to learn about Apex Trigger to Send a Custom Visualforce Component Email Template when Record is Created on Custom Object in Salesforce.

Real time scenarios:- Write a trigger on Custom object (Registration__c) and Send a Custom Visualforce Component Email Template when Record is Created Condition is the Student Name should not be null.

Files we used in this post example

sendCustmTemp.apxt Apex Class Trigger It will be fire whenever a Record is Created Where Student name should not be null.
recipientsController.apxc Apex Class Controller Create Apex controller to send email template through Apex Class Method
emailNotifyTemp Create Classic Email Templates Create Classic Custom Email Templates.
regEmailTempVfc.vfc Visualforce Component Create Visualforce Component.
regTempController.apxc Apex Class Controller It is call on Visualforce Component.

Final Output

Apex Trigger to Send Email Template -- w3web.net

Other related post that would you like to learn…

Create Apex Class Trigger

Step 1:- Create Apex Class Trigger : sendCustmTemp.apxt

From Developer Console >> File >> New >> Apex Class

sendCustmTemp.apxt [Apex Class Controller]

Create Apex Class controller

Step 2:- Create Apex Class : recipientsController.apxc

From Developer Console >> File >> New >> Apex Class

recipientsController.apxc [Apex Class Controller]

Create Classic Email Templates

Step 3:- Create Classic Email Templates : emailNotifyTemp

File >> New >> Classic Email Templates >> emailNotifyTemp

emailNotifyTemp [Classic Email Templates File]

Create Visualforce Component

Step 4:- Create Visualforce Component : regEmailTempVfc.vfc

File >> New >> Visualforce Component >> regEmailTempVfc.vfc

regEmailTempVfc.vfc [Lightning Component File]

Create Visualforce Component Apex Class Controller

Step 5:- Create Apex Class : regTempController.apxc

From Developer Console >> File >> New >> Apex Class

regTempController.apxc [Apex Class Controller]

trigger to send email when record is created -- w3web.net

Other post that would you like to learn in LWC

Leave a Comment

Please Contribute to Support If Some Value Added in Your Project or Website