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
SBNSBN 

General Email Reminder Notification

Hello,

 


I have a requriement to send a couple of users daily an email notification and include some of the salesforce report URLs in that email text body to view.

 

Is there any standard fucntionality in salesforce to just send email notifications to Users? Or Do we need to write the schedular apex to do this task?

 

Thanks

Satish_SFDCSatish_SFDC
Email alerts cannot be sent unless there is a workflow or some code.

So you will have to write a Scheduled Apex class for this.

Regards,
Satish Kumar
SBNSBN

Thank you Satish!!

 

Do you have any sample code of the scheduled apex class which you have used any time before ?

 

Regards

SN

SBNSBN

This is the code that I have written and scheduled but I am not recieveing any emails. Please let me know if you have any idea

 

Global class Schedularclass implements Schedulable{
global void execute (SchedulableContext SC){
 {   
 Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
  mail.setTemplateId('00Xi0000000ViBZ'); //email template id
  String[] bccaddress = new String[]{'gmailid@gmail.com'};
  mail.setBccAddresses(bccaddress);
 Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}
}
}