Overview
This is a step-by-step guide for enabling SMS notifications within your Salesforce CRM. Once enabled, you can use this function during trigger events for both your Salesforce Flows and within Process Builder. SMS & MMS capable numbers within the United States requires an A2P 10DLC campaign for messaging compliance purposes.
Requirements
- Salesforce Administrator Privileges
- Team Inbound Messages in Spoke
- Approved A2P 10DLC Compliance Campaign (US Phone Numbers) in Twilio
Enable SMS Notifications within Salesforce
Named Credentials Setup Steps
In Salesforce, named credentials are a way to securely manage and authenticate external APIs and services. They allow Salesforce developers and administrators to define the URL of an outbound HTTP call and its authentication parameters in one place. This allows the Salesforce platform to handle authentication for Apex callouts, freeing up developers to focus on their code.
Step 1: In Salesforce, go to Setup and search for Named Credentials in the Quick Find search bar.
Step 2: Click on Named Credentials, select the External Credentials Tab and click New.
Step 3: Label & Name as Spoke_SMS, and select No Authentication under Auth Protocol and click Save.
Step 4: Go back to the Named Credential tab and click New.
Step 5: Label & Name as Spoke_SMS and copy & paste the following link in the URL field:
https://afe654be-43e8-4596-b2cf-67bd7a9837cc.trayapp.io/
Step 6: Select the Spoke_SMS under the External Credential dropdown and click Save.
Permission Set Setup Steps
Step 1: In Salesforce, go to Setup and search for Permission Sets in the Quick Find search bar.
Step 2: Click on Permission Sets and click New.
Step 3: Label as Spoke_SMS, and select None under License dropdown and click Save.
Step 4: Click on the External Credential Principal Access link under the Apps section and the Edit.
Step 5: Add the Spoke_SMS permission set and click Save.
Create your Process Builder Flow & Test Action
Step 1: In Salesforce, go to Setup and search for Flow in the Quick Find search bar.
Step 2: Click on Flows under the Process Automation section and click New Flow.
Step 3: As a test, create a Record-Triggered Flow on any object that creates an Action when a record is updated etc.
Step 4: When adding your Action, select create HTTP Callout, name your actions and select Spoke_SMS under the Named Credentials dropdown.
Step 5: Again provide a Label and select POST as the Method. The POST body needs to be strucutred as below and you can assign Query Parameters for your variables as needed:
{
"contactAddress": "{{customer-phone-number}}",
"body": "Your message body",
"routingAction": "assign_team",
"companyAddress": "{{Spoke-Team-phone-Number}}",
"conversationName": "Any Name",
"clientID": "{{Spoke-Client-Id}}",
"secret": "Spoke-Client-Secret}}"
}
Step 5: Connect and test your new Action Trigger.