Sending SMS with JavaScriptJavaScript can be used to send an SMS at any time in a Workflow, and can be a quick and easy way to send off messages without agent involvement.
This function also allows sending messages to selected Mobile Apps such as WhatsApp, when using an appropriate Connector.
How ToInside any JavaScript-manipulating Field (Calculate, JavaScript, JavaScript - Button), use the function specified below.
Simple Syntax
The simple syntax requires a list of parameters:
Script.Sms.Send(connectorType, connectorName, subject, recipients, from, body, defer, callback);
Example:
Alternate Syntax
Since many of the arguments for the above syntax are optional, there is an alternate syntax where a JavaScript object is passed instead. This means that only the desired optional parameters need to be passed:
Any optional parameters that are omitted will use their default value, as stated in the above table. As this is a JavaScript object, the order in which the parameters are listed in this alternate syntax doesn't matter, as long as the key:value pairs are preserved.
NotesAs multiple duplicate SMS can be queued, it is advised that caution is used if this function is invoked in a Calculate Field, due to the way that Calculate Fields will run every time an action is taken or Field's value is altered.
It is also possible to make use of the Script.Message.Send() function to send both SMS and emails.
|