NotifySMS - Global
-
- UpdatedJan 30, 2025
- 8 minutes to read
- Yokohama
- API reference
The NotifySMS script include provides methods that enable you to send Short Message Service (SMS) messages from Notify telephone numbers to devices using either their telephone numbers or a GlideRecord that has a field that contains telephone number information.
To use this script include you must activate the Notify (com.snc.notify) plugin.
NotifySMS - NotifySMS()
Creates an instance of a NotifySMS object.
Name | Type | Description |
---|---|---|
None |
Example
This example shows how to instantiate a NotifySMS object.
NotifySMS - sendBulkSMS(String fromNumber, Array toNumber, String message, GlideRecord sourceRecord)
Triggers an asynchronous flow action that sends a Short Message Service (SMS) message from a specified Notify phone number to a list of phone numbers.
Type | Description |
---|---|
ScriptableFlowRunnerResult | ScriptableFlowRunnerResult - Scoped object. |
Example
The follow code example shows how you can use this method to send a bulk SMS message.
NotifySMS - sendToNumber(String fromNumber, String toNumber, String message, Object sourceRecord)
Sends a Short Message Service (SMS) message from a specified Notify telephone number to a specified telephone number.
In addition, you can optionally associate the Incident record that caused the SMS message to be generated to the SMS message.
Type | Description |
---|---|
None |
Example
The following example illustrates how to send an SMS message to a specified phone number and stamp the associated Incident record with the message information.
NotifySMS - sendToNumbers(String fromNumber, Array toNumber, String message, Object sourceRecord)
Sends a Short Message Service (SMS) message from a specified Notify phone number to a list of phone numbers.
In addition, you can optionally associate the Incident record that caused the SMS message to be generated with the SMS message.
Type | Description |
---|---|
None |
Example
The following example illustrates how to send an SMS message to multiple telephone numbers and store the information in the associated Incident record.
NotifySMS - sendToUser(String fromNumber, Object toGr, String message, Object sourceRecord)
Sends a Short Message Service (SMS) message from a specified phone number to the user identified in a specified GlideRecord.
This method extracts the telephone number from the specified GlideRecord. In addition, you can optionally associate the Incident record that caused the SMS message to be generated with the SMS message.
Type | Description |
---|---|
None |
Example
The following example illustrates how to send an SMS message to a user identified in the associated Incident record and stamp the associated Incident record with the message information.
NotifySMS - sendToUsers(String fromNumber, Object toGr, String message, Object sourceRecord)
Sends a Short Message Service (SMS) message from a specified Notify phone number to users found in a specified GlideRecord.
This method extracts the destination telephone numbers from the passed-in GlideRecord. In addition, you can optionally associate the Incident record that caused the SMS message to be generated with the SMS message.
Type | Description |
---|---|
None |
Example
This example shows how to send an SMS message to users within a specified incident record.
NotifySMS - setRecordToNumberResolver(Object scriptIncludeInstance, String methodName)
Sets the method within a script include to use to obtain the target telephone number in the GlideRecord that is passed in the NotifySMS.sendToUser() and NotifySMS.sendToUsers() methods.
By default, the NotifyUtil.getSMSNumberForUser() method is used to obtain the telephone number from a User [sys_user] based GlideRecord. Use the setRecordToNumberResolver() method if you need to create a custom method to obtain this information from a different record type, such as a Case record.
Name | Type | Description |
---|---|---|
methodName | String | Name of the method to use to obtain the target telephone number in a GlideRecord. |
scriptIncludeInstance | Object | Instance of the script include that contains the specified number resolver method. |
Type | Description |
---|---|
None |
Example
This example shows how to set the phone number resolver to the getSMSNumberForConsumer() method within the csmUtils script include.
Example
This example shows the code needed for the telephone resolver method getSMSNumberForConsumer().
On this page
- NotifySMS - NotifySMS()
- NotifySMS - sendBulkSMS(String fromNumber, Array toNumber, String message, GlideRecord sourceRecord)
- NotifySMS - sendToNumber(String fromNumber, String toNumber, String message, Object
sourceRecord)
- NotifySMS - sendToNumbers(String fromNumber, Array toNumber, String message, Object
sourceRecord)
- NotifySMS - sendToUser(String fromNumber, Object toGr, String message, Object
sourceRecord)
- NotifySMS - sendToUsers(String fromNumber, Object toGr, String message, Object
sourceRecord)
- NotifySMS - setRecordToNumberResolver(Object scriptIncludeInstance, String methodName)