✔ Sinch MessageMedia
× DirectSMS
× MessageNet
× MobiPost
× SMSBroadcast
× SMSCentral
× Streetdata
× WholesaleSMS
The Apex action Send Bulk SMS by Template in Salesforce Flows allows you to send SMS messages to a large list of records (e.g. Leads, Contacts, Accounts, Case) using a single SMS template. It’s designed for bulk processing, making it perfect for Scheduled Flows or handling lists of records efficiently.
Send Bulk SMS by Template
- Action Name: Send Bulk SMS by Template (mercury__MercuryBulkSMSAction)
- Input parameters:
- SMS Template ID: The ID of the mercury__SMS_Template__c record you want to use.
- Record IDs: A collection (list) of Record IDs to send the message to - this supports any object type (e.g. Lead, Contact, Account, Case).
Create a Daily Scheduled Flow for Leads
An example of how to send a daily SMS reminder to all Leads with a specific status.
- Go to Setup and then click Flows.
- Click New Flow.
- Select Schedule-Triggered Flow and click Create.
- Set the schedule by setting the Start Date and Time e.g. Daily at 9:00AM.
- Set Frequency to Daily.
- Get records (e.g. Leads) by adding a Get Records element.
- Label: Get Target Leads
- Object: Lead
- Condition Requirements:
- MobilePhone IsNull False
- Status Equals Working - Contacted (example)
- How Many Records to Store: All records
- Automatically store all fields: Yes
- The Apex Action requires a List of IDs (Collection of Strings), not a List of Records. You can extract Record IDs using a Loop.
- Create a Variable Resource:
- API Name: varLeadIds
- Data Type:Text
- Allow Multiple Values (Collection): Checked (True)
- Add a Loop element to iterate over Get Target Leads.
- Inside the loop, add an Assignment element:
- Variable: varLeadIds
- Operator: Add
- Value: Current Item from Loop > Id
- To get the SMS Template ID, you can hardcode the ID or query it.
- Add a Get Records element.
- Label: Get SMS Template
- Object: SMS_Template__c
- Filter: Name Equals ‘Your Template Name'
- Store the Id.
- Call the Apex Action by adding an Action element.
- Search for Send Bulk SMS by Template.
- Set Input Values:
- Record IDs: {!varLeadIDs} i.e. the collection variable in step 8.
- SMS Template ID: {!Get_SMS_Template.Id} or paste a hardcoded ID e.g. ‘a0A...'
- Save the Flow e.g. Daily Lead SMS Campaign.
- Debug to test with a small set of records.
- Activate when ready.