Automatically Send SMS from Salesforce by ValueText, Messaging app for Salesforce

Having the ability to send SMS text messages from Salesforce is already a super valuable tool to have available to you. The next step beyond this functionality, however, is being able to automatically send SMS from Salesforce according to your business processes. Luckily, this is a feature that apps like ValueText offer out-of-the-box using native Salesforce tools. Whether you are a programmatic developer (you use Apex), or you are a declarative developer (you use Flow), there is a method you can use to automate SMS text messaging from Salesforce.

Why Should You Automate Text Messaging from Salesforce?

As mentioned above, having the ability to send text messages to your customers and prospects is already great, but it can be made even better by removing the manual steps and requirements. Your business users already have established business processes and automations set up, so if you have the ability to enhance these with automated text messaging, it makes complete sense to do so.

If executed correctly, not only will your internal business users have less manual work to complete, but your customers will also receive faster, better and more personal communication from your business. One example of this is when organizations automatically send SMS from Salesforce to remind customers about their appointments, and the customer has the ability to confirm or change the time immediately by replying back.

There are still times when a manually sent, personalized message will be the right option. That being said, there will also likely be a number of scenarios where it makes sense to use a Dynamic Template and automatically send SMS from Salesforce. Considering that your business likely already has a number of automations set up in the form of Flows or Apex code, it should not take too much time to implement automated text messaging.

Automatically Send SMS from Salesforce: Use Cases

From our experience of helping many ValueText customers create custom templates and set up powerful automations, we have identified a number of use cases that appear more frequently than others. Below is a quick overview of the most common use cases when you can automatically send SMS from Salesforce:

  • Appointment Reminders: A quick text message that reminds the customer of an appointment that they have booked for the next day or later that day.
  • Customer Support Feedback Collection: Ask the customer for some constructive feedback or criticism following a case that has recently been closed by the business.
  • Payments Reminders: Helping customers keep up to date with their payments with a gentle reminder via text message.
  • Lead Qualification Bots: Handing off the lead qualification process to an automated text messaging process.
Powerful Chatbots in ValueText, SMS Messaging App for Salesforce

Automatically Send SMS from Salesforce Using Salesforce Flow

To automatically send SMS from Salesforce using Flow, you will need to add a new data element that will be used to create a new Message Bucket record. This Message Bucket record will be used as a record of the message that is to be sent to the customer, but by initially creating it through the Flow it adds the outgoing message to the ValueText application’s queue to be sent.

Send SMS from Salesforce with Flow by ValueText, Messaging app for Salesforce

Given that your business likely has existing Salesforce Flows that support current business processes, the best way to gain value from automated text messaging using Salesforce Flow would be to work with your business units to determine where and when customers should receive messages.

Ultimately, there are four fields that you need to populate on the Message Bucket record to automatically send SMS from Salesforce:

  1. Number (rsplus__Number__c) – This is a Text field that will contain the recipient’s mobile number. This is where ValueText will send the message to.
  2. Related To (rsplus__Related_To__c) – This is a Text field (not a Lookup, but functions similarly) that will contain the Id of the Record that this message is to be related to.
  3. Sender ID (rsplus__Sender_ID__c) – This is a Text field that will contain the sender’s number. This is where ValueText will send the message from.
  4. Template ID (rsplus__Template_ID__c) – This is a Text field that will contain the Name of the Dynamic Template record.

Any number of Flow functions and tools could be used to populate these field values. In the screenshot below, a Contact Record Variable (called ‘contact’) is being used to populate the Number and Related To fields, using fields from the variable that have been populated earlier in the Flow. The Sender ID and the Template ID are being populated using plain text, but these could also be assigned using Variables, Formulas, or Decision Elements to populate values dynamically.

Populate records from Flow by ValueText, Messaging app for Salesforce

Once the Message Bucket record is created in the system, the ValueText Salesforce SMS messaging app will send the message to the recipient and update other relevant fields on the record itself. This message will then also be related to the record specified in the Related To field.

Automatically Send SMS from Salesforce Using Apex

Sending text messages automatically with Apex is very similar to the way it is done using Flow, except that you will be using Apex code to do so instead of Flow Builder’s declarative interface. Underneath, the method is the same: you need to create a new Message Bucket record, and populate those 4 fields.

Once again, the fields you will need to populate are Number (rsplus__Number__c), Sender ID (rsplus__Sender_ID__c), Template ID(rsplus__Template_ID__c), and Related To (rsplus__Related_To__c).

Here is an example of some Apex code that can be used to loop through a list of records (in this case, Contact records) and create a new Message Bucket record (rsplus__SMS_Bucket__c) for each. Keep in mind that the code will need to be changed, depending on the context in which it is used.

List<rsplus__SMS_Bucket__c> SMSList = new List<rsplus__SMS_Bucket__c>();

//
for(contact c: contactsForSMS){
  rsplus__SMS_Bucket__c SMS = new rsplus__SMS_Bucket__c();
  SMS.rsplus__Number__c =c.MobilePhone; // required to send SMS
  SMS.rsplus__Sender_ID__c=’Vlu15415161800’; // sender id is required to send SMS
  SMS.rsplus__Template_ID__c =’T0001’; // Name of the Template
  SMS.rsplus__Related_To__c=c.id; // Id of record this message will be related to
  SMSList.add(SMS);
}

Database.insert(SMSList,false);

}

Code like this could be used in either an Apex Class or an Apex Trigger directly, however it is best practice to use a Class to hold your logic and call that Class from the Trigger.

Summary

Having the ability to automatically send SMS from Salesforce to your customers is something that a business could use to create more value for their customers and improve the efficiency of their team.

Although the ability to manually send one-to-one messages is still possible, having templated messages automatically sent based on different criteria within Salesforce will mean less work for internal staff, reduced costs, and a better experience for your customers.

Other useful articles

Learn how to improve customer communication in Salesforce

Follow Us

Email: sales@valuetext.io ,
Address: 
B103, Kalpataru, Erragadda, Hyderabad, 500018

© 2022 ValueText. All rights reserved