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 | How to send email template through apex trigger

1,054 views

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 in Salesforce

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


TechW3web:-
Apex Trigger to Send a Custom Email Template When Record is Created on Custom Object in Salesforce

Further post that would you like to learn in Salesforce

 

 

FAQ (Frequently Asked Questions)

What is Apex class in Salesforce?

An Apex class is a template or blueprint from which Apex objects are created. Classes consist of other classes, user-defined methods, variables, exception types, and static initialization code.

What do Apex classes do?

An apex class is a blueprint or template from which objects are created. An object is the instance of a class. Apex class detail page. In apex, you can define an outer class also called top-level class, and you can also define classes within an outer class called inner classes.

What language is Apex based on?

Apex is based on familiar Java idioms, such as variable and expression syntax, block and conditional statement syntax, loop syntax, object, and array notation.

Related Topics | You May Also Like

  • Your reaction of the article ▾
 

Hi, This is Vijay Kumar behind the admin and founder of w3web.net. I am a senior software developer and working in MNC company from more than 8 years. I am great fan of technology, configuration, customization & development. Apart of this, I love to write about Blogging in spare time, Working on Mobile & Web application development, Salesforce lightning, Salesforce LWC and Salesforce Integration development in full time. [Read full bio] | | The Sitemap where you can find all published post on w3web.net

6 thoughts on “Apex Trigger to Send a Custom Visualforce Component Email Template when Record is Created on Custom Object in Salesforce | How to send email template through apex trigger”

  1. I really enjoyed reading your memoirs. I am an avid Star Wars fan, as well as an artist, and every once in a while I look for good articles to read on some of the things that interest me. All I had to do was type in Darth Vader and there you where. Keep up the good work, and maybe even check out some of my Star Wars art that I have published on my art profile sometime. satta Matka

    Reply

Leave a Comment