function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sudeep SinghSudeep Singh 

Once the Account record is created into the System a new Email should be sent to the customer stating that the Account is under review and we will get back to you within 72 hours.

Best Answer chosen by Sudeep Singh
sfdc98sfdc98
Hi ,
try below trigger

trigger cretaedaccmail on Account (after insert) {
    
    for(Account a:trigger.new){
        if(a.id!=null || a.Email__c!=null){
Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        String[] sendingTo = new String[]{'abc@gmail.com'};
            semail.setToAddresses(sendingTo);
             semail.setSubject('Single Email message Example');
           semail.setPlainTextBody('Account is under review and we will get back to you within 72 hours');
               Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail});
       
        }
    }
}

if it helps mark as best answer .
Thank you.

All Answers

sfdc98sfdc98
Hi ,
try below trigger

trigger cretaedaccmail on Account (after insert) {
    
    for(Account a:trigger.new){
        if(a.id!=null || a.Email__c!=null){
Messaging.SingleEmailMessage semail = new Messaging.SingleEmailMessage();
        String[] sendingTo = new String[]{'abc@gmail.com'};
            semail.setToAddresses(sendingTo);
             semail.setSubject('Single Email message Example');
           semail.setPlainTextBody('Account is under review and we will get back to you within 72 hours');
               Messaging.sendEmail(new Messaging.SingleEmailMessage[] {semail});
       
        }
    }
}

if it helps mark as best answer .
Thank you.
This was selected as the best answer
PriyaPriya (Salesforce Developers) 

Hi Sudeep,

You can definetly use the trigger for your requirement. 

Sample code has been given in this tutorial which sends email on creation of new record.
https://trailhead.salesforce.com/content/learn/modules/apex_triggers/apex_triggers_intro

If this help, kindly mark it as best answer.

Thank you.

Regards,

Priya Ranjan