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.
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.
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:
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.
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:
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.
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.
If you want to learn more about Salesforce Flows, here are some great courses we’ve picked for you:
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.
If you want to learn more about Salesforce Apex, here are some great courses we’ve picked for you:
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.