Use the SMS integration feature
Send SMS messages using the CXG SMS component
Prerequisites
Complete the SMS connector configuration.
Complete the SMS signature and template configuration.
Complete the CXG SMS component configuration.
Introduction
On the configured SMS component interface, select a recipient from a `Phone` field. Select a configured signature and template. Enter the values for any parameters that the template cannot automatically retrieve. Click Send to send the SMS message.
Using templates
If a template contains SMS variables:
1. Salesforce variables
When you select an associated object, the corresponding Salesforce variable reads its value from that object. If the field is empty, you must enter the value manually.
2. Manually entered values
If a template contains variables that are not from Salesforce, or if a field in an associated object is empty, you must enter the variable values manually before you send the message.
Send SMS messages by calling an Apex class
Prerequisites
Complete the SMS connector configuration.
Complete the SMS signature and template configuration.
Introduction
CXG provides an Apex class that you can call directly to send SMS messages. For more information about Apex classes, see Apex Developer Guide | Salesforce Developers. This section uses a Flow Action as an example to show how to use this class in a CRM. The example demonstrates how to configure the Salesforce interface to add an action that sends an SMS message.
SMS Apex class parameters
`String phone`: The recipient's mobile phone number.
`String objectName`: The name of the associated object. This parameter is used only when `createTask` is set to `true`.
`String recordId`: The ID of the associated object record. This parameter is used only when `createTask` is set to `true`.
`String templateId`: The ID of the `CXG__SmsTemplate__c` object in Salesforce.
`String signId`: The ID of the `CXG__SmsSign__c` object in Salesforce.
`List<CXG.ExternalSmsTemplateParam> templateParams`: This parameter is required if the template contains variables. If there are no template variables, pass `Null`.
`Boolean createTask`: Specifies whether to create a Task object as a sending record after the message is sent.
CXG.ExternalSmsClient.send(String phone, String objectName, String recordId, String signId, String templateId, List<CXG.ExternalSmsTemplateParam> templateParams, Boolean createTask);If you do not want a Task record to be automatically created after an SMS message is sent, set `createTask` to `false`. You can then pass null values for `objectName` and `recordId`. If a Task must be automatically created, you must grant the integration user the `Edit Tasks` permission.
Return parameter
CXG.ExternalSmsSendResponse
`String bizId`: The business ID that is returned by Alibaba Cloud after the SMS message is sent. You can use this ID to query sending records.