NewThe Parts and Inventory Check Agent is live. Watch the run on a real Salesforce org
Commercial & Business Services

Case study

Two-Way SMS Inside Salesforce, Built With Apex, LWC and an SMS Provider API

Customers answer texts faster than emails, but when staff text from personal phones the conversation never reaches the CRM. Drawing on the SMS systems our team has built in Salesforce with Apex, Lightning Web Components and REST integrations, including TextBolt, this is how we bring two-way texting onto the record.

Hands typing a reply in a text message conversation on a smartphoneCommercial & Business Services
ArchitectureA text conversation, kept on the record

A user sends a text from a Lightning Web Component on the Salesforce record, choosing a template or writing freely. Apex calls the SMS provider’s REST API, such as TextBolt, and the outbound message is stored on the record. When the customer replies, the provider sends the inbound message to an Apex REST endpoint in Salesforce, which matches the phone number to the right contact or lead and adds the reply to the conversation. Opt-out keywords update the customer’s consent so no further texts are sent, and Flow can send automated texts such as appointment reminders under the same rules.

  1. Compose

    • Conversation component
    • Templates
    • Merge fields

    Texting happens where the customer record is.

  2. Send

    • Apex callout
    • SMS provider API
    • Message record

    Every outbound text is stored.

  3. Receive

    • Apex REST endpoint
    • Number matching
    • Reply on record

    Replies land on the right contact or lead.

  4. Respect consent

    • Opt-out keywords
    • Consent field
    • Send checks

    No text goes to someone who opted out.

  5. Automate

    • Flow triggers
    • Reminders
    • Follow-ups

    Automated texts follow the same rules.

The situation this design answers

Text messages get read. For appointment confirmations, quick questions, quote follow-ups and reminders, a text often gets a reply in minutes where an email waits for days. So staff text customers, and very often they do it from their own phones.

That creates a gap the business cannot see. The conversation that settled an appointment time or answered a pricing question lives on one person's phone. The CRM shows nothing. When that person is away, nobody else can pick up the thread. When they leave, the history goes with them. And there is no consistent handling of customers who ask not to be texted.

Our team has built SMS systems inside Salesforce with custom Apex, Lightning Web Components and REST-based integrations, including with TextBolt. This study brings that work together around a common situation: a service business that wants two-way texting on the customer record, available to the whole team and governed by the same rules as everything else in the CRM.

What we build

01 A conversation view on the record

A Lightning Web Component on the contact, lead or case shows the text conversation like a messaging app: messages in order, outbound and inbound clearly separated. Staff can reply directly from the record. Anyone on the team can see the full history.

02 Templates with merge fields

Common messages, such as appointment confirmations or quote follow-ups, are available as templates that pull in the customer's name, appointment time or quote details. Staff save time and messages stay consistent.

03 Sending through an SMS provider API

When a user sends a message, Apex calls the SMS provider's REST API, such as TextBolt, and stores the outbound message on the record with its status. The provider handles delivery; Salesforce holds the record.

04 Receiving replies with an Apex REST endpoint

Replies arrive at an Apex REST endpoint in Salesforce. The endpoint normalizes the sender's number, matches it to the right contact or lead and adds the message to the conversation. Replies that cannot be matched are flagged so a person can link them, instead of disappearing.

Opt-out keywords in a reply update the customer's consent automatically. Every outbound send, manual or automated, checks consent before it goes. Customers who ask to stop receiving texts are respected without anyone having to remember.

06 Automation with Flow

Flow can send automated texts, such as appointment reminders or follow-ups after a quote, using the same templates, the same sending path and the same consent checks as manual messages.

A conversation, end to end

A customer requests a quote through the website. The next morning, a team member opens the lead in Salesforce and sends a short text from the conversation view, using a template that includes the customer's name. The message goes out through the SMS provider and appears on the record.

The customer replies an hour later with a question about timing. The reply reaches the Apex endpoint, is matched to the lead by phone number and appears in the conversation. A different team member, covering that afternoon, sees the whole exchange and answers.

The day before the agreed appointment, a Flow sends an automated reminder. The customer replies "STOP" because they no longer want texts. Their consent updates automatically, and no further texts will be sent to them, manual or automated.

Why inbound matching is the hardest part

Sending a text from Salesforce is straightforward. Receiving the reply and putting it in the right place is where most SMS projects struggle.

Phone numbers are stored inconsistently: with or without country codes, spaces or leading zeros. The same number can appear on several records, such as a contact and an older lead. Customers sometimes reply from a different number. A reliable design normalizes numbers on both sides, uses the most recent conversation to choose between duplicates, and flags anything ambiguous for a person instead of guessing. That is what turns texting from a convenience into a dependable part of the customer record.

Why build it with Apex and LWC

There are good packaged SMS apps for Salesforce, and for many teams they are the right answer. Custom Apex and Lightning Web Components make sense when the business needs texting to follow its own rules: a particular conversation layout on a particular record, templates tied to specific data, consent rules that match its compliance obligations, or automation that a package does not support.

Building it this way also keeps the integration transparent. The sending logic, the inbound endpoint and the matching rules are code the business owns and can test alongside the rest of its org, instead of behavior hidden inside a package.

Templates, timing and tone

Text messages are short, personal and arrive on the device people carry everywhere. That makes them effective, and it makes mistakes more noticeable than in email.

Keep templates short and specific. A good text says who it is from, why it is being sent and what the customer should do next, in a sentence or two. Templates are written with that discipline, and merge fields fill in the details that make each one personal.

Respect the clock. Automated texts are scheduled for reasonable hours in the customer's time zone. A reminder at an unsociable hour undoes the goodwill the channel creates.

Identify the business. Customers should never wonder who is texting them. Messages make the sender clear, especially the first message in a conversation.

Make replies welcome. Two-way texting only works if customers know they can reply. Messages are written to invite a response where one is useful, and the conversation view makes sure someone sees it.

Know when to switch channels. Some conversations outgrow a text, such as detailed quotes or sensitive matters. Staff can move the conversation to a call or email, and the text history remains on the record for context.

Getting these details right is what turns a technical integration into a channel customers appreciate rather than tolerate.

How we deliver SMS in Salesforce, end to end

Decide build or buy first. We compare packaged options with a custom build against the business's real requirements before writing code.

Design consent up front. Opt-out handling and send checks are designed before any message is sent.

Normalize and match. Phone number handling and inbound matching are specified and tested with realistic, messy data.

Build the conversation view for staff. The component is designed to make texting from Salesforce easier than texting from a phone.

Automate last. Automated texts are added once manual texting works, using the same rules.

The decisions that matter

The record is the home of the conversation. Every message, in and out, is stored where the team can see it.

Consent is enforced by the system. People should not have to remember who opted out.

Ambiguity goes to a person. Unmatched replies are flagged, never guessed.

What changes

AreaTexting from personal phonesTexting inside Salesforce
VisibilityConversations invisible to the businessFull history on the customer record
ContinuityLost when someone is away or leavesAny team member can continue the conversation
ConsistencyEvery message written from scratchTemplates with merge fields
RepliesStay on one person's phoneMatched to the right contact or lead
Opt-outsRemembered, or notConsent updated and checked automatically
RemindersSent manuallyAutomated by Flow under the same rules

What we would tell a team considering SMS in Salesforce

Get the conversations off personal phones and onto the record. Decide honestly whether a package fits or a custom build is needed, design consent before you send a single message, and spend your engineering effort on matching replies to the right customer. Do that, and texting becomes one of the most responsive and best-recorded channels your team has.

Common questions

Answered, directly.

What buyers ask about delivering this in commercial & business services.

Packaged apps are a good choice when their workflow fits. Custom Apex and LWC make sense when texting has to follow specific business rules, appear in a particular place on the record, or feed automation that a package does not support. We help teams decide which route fits before building anything.

The inbound endpoint normalizes the sender’s phone number and matches it to contacts and leads, using the most recent conversation when a number appears on more than one record. Unmatched replies are flagged for a person to resolve instead of being lost.

Opt-out keywords in an inbound message update the customer’s consent automatically, and every outbound send, whether manual or automated, checks consent before it goes. This protects customers and keeps the business compliant with messaging rules.

Free architect conversation

Talk to an architect, not a sales rep.

60 seconds to brief us, and a certified architect replies within one business day.

What are you looking to architect?

Pick the closest fit. You can add detail in a moment.

Which clouds or systems are in scope?

Optional. Choose any that apply, or skip ahead.

Where does your org stand today?

Optional. A few sentences is plenty: what is working, what is stuck, and what you want to be true. Or skip ahead and tell us on the call.

Who should the architect reach?

A certified architect will reply to these details.

Takes about 30–60 seconds · No obligation · Architect replies within one business day

Protected by reCAPTCHA. Google's Privacy Policy and Terms apply.

The thinking behind this

Related reading

Where this sits

Salesforce Development

This work is delivered through our salesforce development practice.

Talk to us about custom development

More delivery

Related case studies

  • SynconAI Consulting are Simply the Best in the Business When it comes to Salesforce implementation and AI-powered solutions, SynconAI are in a league of their own. Their expertise, dedication, and ability to deliver results that truly move the needle sets them apart from every other consulting partner we've worked with. What they achieved with our Sales Cloud, Service Cloud, and custom Agentforce agent has completely transformed how we operate streamlining our pipelines and our customer service, and automating tasks that used to consume hours of our team's time. They don't just implement technology they transform businesses. If you want the best, you work with their team.

    Jack BennettConsumer Goods & RetailUnited States

  • I had a very urgent deadline for our project reporting to be delivered and needed to build the module, dashboard and output reports in Salesforce. SynconAI were very responsive - they met with me online, responded to my emails quickly and took calls - whatever was needed to progress the work quickly. We are thrilled with the outcome and will continue to work with SynconAI in the future to continue to build our Salesforce capability and platform.

    Salesforce Managed ServicesAustralia

  • The team at SynconAI were fantastic, and promptly delivered on each project. They were able to guide us through every stage and made sure we were satisfied with the outcomes on multiple scopes of work.

    ManufacturingAustralia

  • They have been great and helping us transform out business by bringing what I conceptualize to life. Great at translating process/workflow needs into a solution. Been a pleasure work with and they're a critical part of our team and will be instrumental into bringing about my vision.

    Financial ServicesUnited States

  • Working with SynconAI was a seamless and highly professional experience from start to finish. They took the time to deeply understand our business processes before designing and implementing a Salesforce solution tailored specifically to our operational needs. The team demonstrated strong technical expertise across Salesforce configuration, automation, integrations, reporting, and user experience design.

    Salesforce Implementation

Request a demo

Request a demo

An architect shows you a live agent on a real Salesforce org and walks through how this one would work in yours. We reply within one business day.

No obligation. An architect replies, not a sales sequence.

Protected by reCAPTCHA. Google's Privacy Policy and Terms apply.