
Now, a popup window will appear for you to enter the SMS body and click the Send SMS button to send the SMS.īy using the Twilio account, we can send SMS to any country. A Mobile number should be present in that lead record. Step 5: Create a custom button (To send the SMS) in the Lead object, and add it to the page Layout.Ĭlick the Send SMS button on the Lead object detail page. Step 4: Create a Visualforce Page (To send the SMS) (res.getBody(),errorResponseWrapper.class) (,'SMS Sent Successfully')) Įrw =(errorResponseWrapper)serialize (fromPhNumber,'UTF-8')+'&Body='+smsBody) ĪpexPages.addmessage(new ssage (phNumber,'UTF-8')+'&From='+EncodingUtil.urlEncode Req.setHeader('Accept-Charset', 'utf-8') Req.setHeader('Accept', 'application/json') Req.setHeader('User-Agent', 'twilio-salesforce/' + VERSION) Req.setHeader('X-Twilio-Client', 'salesforce-' + VERSION) Token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' Īccounts/'+accountSid+'/SMS/Messages.json') PhNumber ='+'+Apexpages.currentpage().getparameters().ĪccountSid = 'xxxxxxxxxxxxxxxxxxxxxxxxxx' In this class, we need to replace the value of the AccountSid variable with the ACCOUNT SID value, also replace the value of the token variable with the AUTH TOKEN, and replace the value of the fromPhNumber variable with the From phone number you got from the Twilio Account.

In the trial account, you can send the SMS to only the verified numbers so, you must verify all the phone numbers you are going to send the SMS.Ĭreate a Remote Site Settings in Salesforce for the below URL In this article, I have explained the steps for sending an SMS from Salesforce to mobile phones.įirst, create a trial account in and then get the API Credentials for making the API calls, and also create a phone number for your account from which you can send the SMS.
#TWILIO SEND SMS HTTP POST SOFTWARE#
Twilio is a cloud communication company that allows software developers to programmatically make and receive phone calls, and send and receive text messages using its web service APIs
