Send SMS from Salesforce
In this article, we are going see how an SMS can be sent from Salesforce using ‘SMS Magic Interact’ application. Sending SMS notifications to customers makes business processes faster than ever before. Salesforce doesn’t provide any standard feature to send SMS, but we can send SMS notifications to Leads, Accounts and to the records in custom objects. Customer follow-up can be done easily by sending SMS notifications with the help of ‘SMS Magic Interact’ app that is available in Salesforce AppExchange.
- Send SMS to standard & custom object’s records.
- Easy to Configure and Customize.
- Can send Bulk-SMS.
- Schedule SMS.
SMS can be sent to Lead, Contact, and Users, and also by directly entering Mobile Number via ‘SMS Home’.
SMS templates can be created to send SMS messages similar to Email template. Before creating an SMS template, we need to create a ‘Template Type’, which specifies to which object the SMS template is created.
This object holds all SMS records that are sent from Salesforce and is associated with the corresponding Lead or Account.
This object holds all SMS records that are received by Salesforce and is associated with the corresponding Lead or Account. In order to associate an incoming SMS with Lead or Account, we need to configure in ‘Incoming Lookup’ within ‘SMS Settings’ by creating a ‘New Incoming Lookup’ record.
If there are a list of ‘Phone’ fields (Home Phone, Office Phone, Personal Mobile) on Account, then we need to configure a specific field, and based on that field value the incoming SMS will be associated with the right record.
For example, if ‘Personal Mobile’ field is configured, then the SMS received from ‘Personal Mobile’ field value would be associated with the corresponding Account record. i.e. the record that has the same ‘Personal Mobile’ field value as the incoming SMS.
Action on Incoming SMS:
When Salesforce receives an ‘Incoming SMS’, the following records can be created:
By clicking on ‘New Action on Incoming SMS’ within ‘SMS Settings, you can create a new action.
This setting is to prevent sending SMS for Lead or Account who has unsubscribed from receiving SMS.
If Salesforce receives any text which contains the keyword for ‘Unsubscription’, then automatically ‘Opt-out’ setting (‘Opt-out’ field [Checkbox]) for the corresponding Lead or Account would be checked based on the Mobile number from which the SMS is received.
Stop & Unsubscribe are the keywords configured for Lead to enable ‘Opt-out’. If a Lead replies for the SMS sent from Salesforce with the text containing ‘Stop or Unsubscribe’, then automatically ‘Opt-out’ for the Lead would be enabled and the Lead would not receive any SMS from Salesforce until ‘Opt-out’ is disabled.
SMS can be sent when a particular process is complete or at a specific time using ‘SMS on Workflow’. ‘SMS on Workflow’ is an upgrade package used for scheduling the SMS.
1. Go to ‘SMS on Workflow’ tab.
2. Click on [New SMS Workflow] button.
Enter the values as shown below and click the [Create] button. Automatically, ‘Configuration Name’ would be populated as highlighted above.
Sending SMS using Apex API:
SMS can be sent using the below API from an APEX class, Also, this class can be scheduled and the SMS would be sent when the criteria specified in the class is met.
List <smagicinteract__smsmagic__c>; smsObjectList = new List <smagicinteract__smsmagic__c>(); String senderId = 'smsMagic'; String templateText = 'test SMS by Screen Magic'; // you can fetch the template text by querying the record on smagicinteract__SMS_Template__c object smagicinteract__smsMagic__c smsObject = new smagicinteract__smsMagic__c(); smsObject.smagicinteract__SenderId__c = senderId; smsObject.smagicinteract__PhoneNumber__c = contact.MobilePhone; smsObject.smagicinteract__Name__c = contact.Name; // records name smsObject.smagicinteract__ObjectType__c = 'Contact'; // record type smsObject.smagicinteract__disableSMSOnTrigger__c = 0; // this field either be 0 or 1, if you specify the value as 1 then sms will not get send but entry of sms will get create under SMS History object smsObject.smagicinteract__external_field__c = smagicinteract.ApexAPI.generateUniqueKey(); smsObject.smagicinteract__SMSText__c = templateText; smsObjectList.add(smsObject); Database.insert(smsObjectList,false);
SMS template as well as text for sending SMS can be used within this API.
SMS Magic Interact offers texting solution in Salesforce. As a result of it, now businesses can collaborate, follow up, and interact with their customers more efficiently.