Step by Step Guide on Sending & Receiving SMS From / In Salesforce

Here is another interesting step-by-step DIY (do-it-yourself) guide for you—how to send & receive SMS from/in Salesforce (one-way / two-way). And you'll be surprised how easy this is. But first things first. Currently (as of this writing) Salesforce does not provide any native capability to allow you to send SMSes, which means that you will need to use a third-party SMS Gateway. You can either select one of the 3rd-party products available on AppExchange (which will provide you a more seamless integration with Salesforce) or any other SMS Gateway that allows API calls. In this guide, I will be using Twilio to demonstrate the end-to-end functionality.

The steps that we are going to be following are as follows:

Some amount of Apex coding is required to send & receive SMS in Salesforce using Twilio, and I have included detailed step-by-step instructions with screenshots & sample code on how to do it. Even if you are from a non-development background, you should be able to follow this guide quite easily. But if you do get stuck along the way, leave a comment below and I will try my best to help you.

So let's dig in…

Though I have used Twilio in this guide, there are quite a few 3rd-party products on AppExchange that provide the functionality to send SMS from Salesforce. Navigate to URL https://appexchange.salesforce.com/results?keywords=SMS to review the different products available on AppExchange. Each product will have its own way to configure and send SMS. Also, worthwhile to mention here is that you can also use Salesforce's "Marketing Cloud" to send SMSes.

And why would you want to send SMS from Salesforce in the first place? Well, here are some of the use cases that I can think of:

  • Send appointment reminders

  • Send updates on orders, deliveries, cases

  • Billing & payment alerts / reminders

  • Send satisfaction surveys

  • Send mass notifications / alerts

  • Two-factor authentication

  • Send promotional offers / run campaigns

  • Send discount coupons or vouchers

  • Etc.

References & Useful URLs

  1. The Twilio Salesforce Helper Library

  2. Twilio Salesforce Project on GitHub

  3. https://developer.salesforce.com/blogs/developer-relations/2012/02/quick-tip-public-restful-web-services-on-force-com-sites.html

  4. https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_rest_code_sample_basic.htm