Docs/Developers & integrations/Send Bulk or Single SMS via Apex

Send Bulk or Single SMS via Apex

You can send SMS from Apex by creating a record on the Message Bucket object (rsplus__SMS_Bucket__c).

Last updated 28 Nov 2025
You can also send bot questions by mapping a bot element ID to the Message Bucket field. See the section below for how to find it.

Example: Sending SMS from a Contact Update

apex
Trigger SendSMSOncontact on Contact (after update){
List sc-camel-sms-for-sending=new List();
for(contact c: trigger.new){
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=’VluTxt’; // sender id is required to send sms
sms.rsplus__Message__c =’Welcome to ValueText’; // message body is required to send sms
OR // You have to select rsplus__Message__c or rsplus__Template_ID__c or Bot element
sms.rsplus__Template_ID__c =’T0001’; // Template ID bust be name (API field of SMS Templates) of the Template
OR
sms.rsplus__Bot_Element__c=’a1b0I000003s1jZQAQ’;// Please refer for how to add Bot Element.
sms.rsplus__Related_To__c=c.id; // Optional – id of the the record.
smsForSending.add(sms);
}// end of for
Database.insert(smsForSending,false);
}// end of trigger

Find the Bot Element ID for rsplus__Bot_Element__c

To add a bot element ID to the rsplus__Bot_Element__c field of the message bucket:

  1. Choose the bot. Go to Salesforce > Bot tab, choose the bot you want to send as an SMS, and open it. You will see the Bot Element lookup field; open it.
Salesforce Bot detail page for the
Fig 01
  1. Copy the record ID. Click the lookup field on the bot record to open the bot element record. Copy the ID from the browser URL and map it to the rsplus__Bot_Element__c field.
Salesforce Bot Element record page for BTE-0029, with the record ID highlighted in the browser address bar (rsplus__Bot_Element__c/a1b0I000003s1jZQAQ/view).
Fig 02
Was this helpful?
← PreviousSingle SMS API Reference Next →ChatGPT Integration with Salesforce
Docs/Developers & integrations/Send Bulk or Single SMS via Apex

Send Bulk or Single SMS via Apex

You can send SMS from Apex by creating a record on the Message Bucket object (rsplus__SMS_Bucket__c).

Last updated 28 Nov 2025
You can also send bot questions by mapping a bot element ID to the Message Bucket field. See the section below for how to find it.

Example: Sending SMS from a Contact Update

apex
Trigger SendSMSOncontact on Contact (after update){
List sc-camel-sms-for-sending=new List();
for(contact c: trigger.new){
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=’VluTxt’; // sender id is required to send sms
sms.rsplus__Message__c =’Welcome to ValueText’; // message body is required to send sms
OR // You have to select rsplus__Message__c or rsplus__Template_ID__c or Bot element
sms.rsplus__Template_ID__c =’T0001’; // Template ID bust be name (API field of SMS Templates) of the Template
OR
sms.rsplus__Bot_Element__c=’a1b0I000003s1jZQAQ’;// Please refer for how to add Bot Element.
sms.rsplus__Related_To__c=c.id; // Optional – id of the the record.
smsForSending.add(sms);
}// end of for
Database.insert(smsForSending,false);
}// end of trigger

Find the Bot Element ID for rsplus__Bot_Element__c

To add a bot element ID to the rsplus__Bot_Element__c field of the message bucket:

  1. Choose the bot. Go to Salesforce > Bot tab, choose the bot you want to send as an SMS, and open it. You will see the Bot Element lookup field; open it.
Salesforce Bot detail page for the
Fig 01
  1. Copy the record ID. Click the lookup field on the bot record to open the bot element record. Copy the ID from the browser URL and map it to the rsplus__Bot_Element__c field.
Salesforce Bot Element record page for BTE-0029, with the record ID highlighted in the browser address bar (rsplus__Bot_Element__c/a1b0I000003s1jZQAQ/view).
Fig 02
Was this helpful?
← PreviousSingle SMS API Reference Next →ChatGPT Integration with Salesforce
Docs/Developers & integrations/Send Bulk or Single SMS via Apex

Send Bulk or Single SMS via Apex

You can send SMS from Apex by creating a record on the Message Bucket object (rsplus__SMS_Bucket__c).

Last updated 28 Nov 2025
You can also send bot questions by mapping a bot element ID to the Message Bucket field. See the section below for how to find it.

Example: Sending SMS from a Contact Update

apex
Trigger SendSMSOncontact on Contact (after update){
List sc-camel-sms-for-sending=new List();
for(contact c: trigger.new){
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=’VluTxt’; // sender id is required to send sms
sms.rsplus__Message__c =’Welcome to ValueText’; // message body is required to send sms
OR // You have to select rsplus__Message__c or rsplus__Template_ID__c or Bot element
sms.rsplus__Template_ID__c =’T0001’; // Template ID bust be name (API field of SMS Templates) of the Template
OR
sms.rsplus__Bot_Element__c=’a1b0I000003s1jZQAQ’;// Please refer for how to add Bot Element.
sms.rsplus__Related_To__c=c.id; // Optional – id of the the record.
smsForSending.add(sms);
}// end of for
Database.insert(smsForSending,false);
}// end of trigger

Find the Bot Element ID for rsplus__Bot_Element__c

To add a bot element ID to the rsplus__Bot_Element__c field of the message bucket:

  1. Choose the bot. Go to Salesforce > Bot tab, choose the bot you want to send as an SMS, and open it. You will see the Bot Element lookup field; open it.
Salesforce Bot detail page for the
Fig 01
  1. Copy the record ID. Click the lookup field on the bot record to open the bot element record. Copy the ID from the browser URL and map it to the rsplus__Bot_Element__c field.
Salesforce Bot Element record page for BTE-0029, with the record ID highlighted in the browser address bar (rsplus__Bot_Element__c/a1b0I000003s1jZQAQ/view).
Fig 02
Was this helpful?
← PreviousSingle SMS API Reference Next →ChatGPT Integration with Salesforce
Docs/Developers & integrations/Send Bulk or Single SMS via Apex

Send Bulk or Single SMS via Apex

You can send SMS from Apex by creating a record on the Message Bucket object (rsplus__SMS_Bucket__c).

Last updated 28 Nov 2025
You can also send bot questions by mapping a bot element ID to the Message Bucket field. See the section below for how to find it.

Example: Sending SMS from a Contact Update

apex
Trigger SendSMSOncontact on Contact (after update){
List sc-camel-sms-for-sending=new List();
for(contact c: trigger.new){
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=’VluTxt’; // sender id is required to send sms
sms.rsplus__Message__c =’Welcome to ValueText’; // message body is required to send sms
OR // You have to select rsplus__Message__c or rsplus__Template_ID__c or Bot element
sms.rsplus__Template_ID__c =’T0001’; // Template ID bust be name (API field of SMS Templates) of the Template
OR
sms.rsplus__Bot_Element__c=’a1b0I000003s1jZQAQ’;// Please refer for how to add Bot Element.
sms.rsplus__Related_To__c=c.id; // Optional – id of the the record.
smsForSending.add(sms);
}// end of for
Database.insert(smsForSending,false);
}// end of trigger

Find the Bot Element ID for rsplus__Bot_Element__c

To add a bot element ID to the rsplus__Bot_Element__c field of the message bucket:

  1. Choose the bot. Go to Salesforce > Bot tab, choose the bot you want to send as an SMS, and open it. You will see the Bot Element lookup field; open it.
Salesforce Bot detail page for the
Fig 01
  1. Copy the record ID. Click the lookup field on the bot record to open the bot element record. Copy the ID from the browser URL and map it to the rsplus__Bot_Element__c field.
Salesforce Bot Element record page for BTE-0029, with the record ID highlighted in the browser address bar (rsplus__Bot_Element__c/a1b0I000003s1jZQAQ/view).
Fig 02
Was this helpful?
← PreviousSingle SMS API Reference Next →ChatGPT Integration with Salesforce