You need to sign in to do that
Don't have an account?
sending single email to salesforce through scheduled job
Hi everyone ,
This is scheduled job code ,
global class TwilioSchedule_Weekly_SMS Implements Schedulable{
global void Execute(SchedulableContext SC)
{
ScheduledSMS();
}
static void ScheduledSMS()
{
List<Account> acc = [SELECT Id, Mobile__c from Account where Weekly_Scheduled_SMS__c = true];
if(acc.size() != 0){
for(Account a: acc){
TwilioMessageController obj = new TwilioMessageController();
obj.messageBody = 'test test ';
obj.WhoId = a.Id;
obj.sendToPhones.add(a.Mobile__c);
obj.onSend();
}
}
}
}
in this code i am sending sending sms to the accounts on scheduled basis . After the sms is sent i want to send an email on the particular email address with the name of the all the accounts to whom the SMS is sent saying that SMS to all the accounts were sent successfully
Thanks ,
Rajesh
Rajesh,
Try something like this:
If this helps, please mark it as a solution, and give kudos (click on the star) if you think I deserve them. Thanks!
-Glyn Anderson
Certified Salesforce Developer | Certified Salesforce Administrator
Hi Rajesh,
You can use the Outbound email feature from Salesforce to send out email to the person using a VF template that can show the list of Accounts you pull out in the ScheduledSMS() function.
Read more:
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_forcecom_email_outbound.htm
Hope this helps!