Sending Messages With Automation

You can use Text Anything to send automated text messages with Flows or by an Apex Class

Note:

  • Automated messaging is supported worldwide

  • From numbers must be registered to an approved and active A2P Campaign for US & Canadian to numbers

  • Test your campaigns thoroughly before enabling


Sending Messages Using Apex

To send automated text messages using an Apex Class (i.e., a scheduler class or trigger) do the following:

Create a list variable with the name: “textany.TextAnythingSendAutomatedSMSController.Requests”. The inputs of this list variable class are:

  1. recordId (Required)

  2. strFromNumber (Required)

  3. strToNumber (Required)

  4. strSMSBody

  5. strMediaUrl //This should be public URL of image/gif/pdf/csv.

Once the list is ready, call the class method: textany.TextAnythingSendAutomatedSMSController.sendSMSAutomation(LISTNAME);

Note - User needs to provide either strSMSBody or strMediaUrl or both (if sending a MMS). At least one variable cannot be NULL.


list listRequests = new list();

textany.TextAnythingSendAutomatedSMSController.Requests objReq = new textany.TextAnythingSendAutomatedSMSController.Requests();
objReq.recordId = '0030I00002QPWVYQA5';
objReq.strSMSBody = 'This SMS sends from automated queueable class. 1';
objReq.strFromNumber = '+1703XXXXXXX';
objReq.strToNumber = '+1804XXXXXXX';
//objReq.strMediaUrl = '';
listRequests.add(objReq);

textany.TextAnythingSendAutomatedSMSController.Requests objReq1 = new textany.TextAnythingSendAutomatedSMSController.Requests();
objReq1.recordId = '0030I00002QPWVYQA5';
//objReq1.strSMSBody = '';
objReq1.strFromNumber = '+1703XXXXXXX';
objReq1.strToNumber = '+1804XXXXXXX';
objReq1.strMediaUrl = 'https://sample-videos.com/img/Sample-png-image-100kb.png';
listRequests.add(objReq1);

textany.TextAnythingSendAutomatedSMSController.sendSMSAutomation(listRequests);

Sending Messages Using Salesforce Flow

Sending automated messages with flows is easy and requires the same inputs as sending with an Apex Class.

First create a new action using the “Send SMS” SMS Controller from the Text Anything package.

Next, specify your input values: From Number, Recordid, To Number, optional Media URL and SMS Body.

Previous
Previous

Utility Bar Text Manager

Next
Next

Call Forwarding and Default Messages