Skip to content

Insights · Contact Center

Sending and Receiving SMS in Salesforce with Twilio

How to add two-way SMS to Salesforce with Twilio: use cases, integration options, US carrier registration, consent and opt-out handling.

Illustration for Sending and Receiving SMS in Salesforce with Twilio

Key takeaways

  • Two-way SMS from Salesforce speeds up reminders, follow-ups and support, with every message logged on the record.
  • Integrations range from AppExchange apps to custom builds on Twilio’s messaging API with webhooks for inbound messages.
  • US business texting from standard 10-digit numbers requires A2P 10DLC registration; toll-free numbers require verification.
  • Consent, opt-out handling and quiet hours are legal and reputational essentials.

Customers read text messages far more reliably than email. Sending reminders, confirmations and quick questions by SMS from Salesforce, and seeing replies on the same record, shortens response times and removes a lot of phone tag. Twilio is one of the most widely used platforms for doing this.

Common use cases

  • Appointment reminders with confirm or reschedule replies.
  • Lead follow-up within minutes of a form submission.
  • Order, delivery and service updates.
  • Payment reminders with secure payment links.
  • Support conversations that move from SMS to a case.

How the integration works

  • Outbound: Salesforce calls Twilio’s Messaging API from Flow or Apex with the recipient, sender number and message body.
  • Inbound: Twilio sends incoming messages to a webhook, which creates or updates a message record in Salesforce linked to the right contact, lead or case.
  • Status: delivery status callbacks update each message, so failures are visible.
  • Conversation view: a Lightning component shows the thread on the record and lets users reply.

Build or buy?

OptionGood forConsider
AppExchange SMS appsFast setup with standard featuresLicensing per user or message; fit with your data model
Salesforce messaging channelsTeams using Salesforce’s own digital engagement productsProduct licensing and setup
Custom Twilio integrationSpecific workflows, custom objects, automation and cost controlBuild and maintenance effort

US registration requirements

In the United States, carriers require businesses sending application-to-person (A2P) messages from standard 10-digit long code numbers to register their brand and messaging campaigns, a process known as A2P 10DLC. Unregistered traffic is filtered or blocked. Toll-free numbers used for messaging require their own verification. Registration takes time, so start it early in the project.

Consent and opt-outs

  • Collect clear consent before sending marketing or automated messages, and record when and how it was given.
  • Honor opt-out keywords such as STOP immediately and sync opt-out status to Salesforce.
  • Identify your business in messages and keep content relevant to what the customer agreed to receive.
  • Respect quiet hours and local regulations; consult counsel on telemarketing and consumer protection rules that apply to you.

Healthcare and sensitive data

If messages may include protected health information, confirm that your messaging vendor will sign a business associate agreement and keep content to the minimum necessary. Many healthcare organizations send neutral reminders by SMS and direct patients to a secure portal for details.

Design tips

  • Use templates with merge fields, and preview them before activating automation.
  • Route inbound replies to the record owner or a queue, with notifications.
  • Store phone numbers in a consistent international format.
  • Report on delivery rates, reply rates and opt-outs by template.

We build SMS and calling integrations for Salesforce with Twilio and other providers; see our system integration services.

A worked example: appointment reminders

A scheduled flow runs each morning and finds appointments for the next day. For each one it sends a text from the clinic’s registered number: the date, time and location, with “Reply C to confirm or R to reschedule.” Replies arrive through Twilio’s webhook and are matched to the contact by phone number. A “C” marks the appointment confirmed; an “R” creates a task for the scheduling team; anything else is routed to a person. Delivery failures are logged so staff can call those patients instead.

Data model essentials

RecordKey fields
MessageDirection, body, status, sent and delivered times, Twilio message ID
Conversation or threadContact or lead, phone numbers, last message, owner
ConsentChannel, status, date and source of consent or opt-out
TemplateName, body with merge fields, purpose, active flag

Keeping messages as records, rather than only as activity notes, makes reporting on delivery, replies and opt-outs straightforward.

Frequently asked questions

Can customers reply to texts sent from Salesforce?

Yes. Inbound replies arrive through Twilio webhooks and are logged on the matching Salesforce record.

Do we need to register to send business texts in the US?

Yes, for most business messaging from 10-digit numbers, through A2P 10DLC registration; toll-free numbers need verification.

Can SMS be automated with Flow?

Yes. Record-triggered and scheduled flows can send messages through an integration, for example reminders before appointments.

Saad Ahmad

Founder & Salesforce Application Architect, CodersRegion

Saad founded CodersRegion and has spent more than 13 years designing, building and rescuing Salesforce and custom software platforms for companies in the US, UK, Canada and Australia. Saad holds eight Salesforce certifications, including Application Architect.

Keep reading

More from Insights

Free discovery call

Have a Salesforce project in mind?

Talk to a certified Salesforce consultant about your goals. You get honest advice and a clear plan, with no obligation.