You need to sign in to do that
Don't have an account?
Iswarya Sekar
I'm not getting any email notifications. what's wrong in my code?
use email templates in scheduler apex
global class scheduledBatchable implements Schedulable { global void execute(SchedulableContext sc) { Messaging.SingleEmailMessage msg = new Messaging.SingleEmailMessage(); Case cs = [SELECT id, CLOSED__c, Status FROM Case WHERE CLOSED__C=TRUE]; EmailTemplate template = [SELECT id,Name, DeveloperName, OwnerId FROM EmailTemplate WHERE DeveloperName = 'P1_Followup_Remainder']; msg.setTemplateId(template.Id); msg.setSenderDisplayName('is@gmail.com'); msg.setTargetObjectId(cs.Id); msg.setSaveAsActivity(false); Messaging.sendEmail(new Messaging.SingleEmailMessage[] { msg }); } }
I'm not getting any email notifications. what's wrong in my code?
Please check following sample code.You are not specifying message.toAddresses = new String[] { 'Admin@gmail.com' }; in your code;
Hope this helps you!
Thanks
Varaprasad
@For Support: varaprasad4sfdc@gmail.com