NotifyNow - sendSMS(String phoneNumber, String smsBody, GlideRecord source)
Sends an SMS message to an E.164-compliant mobile phone number.
Notify supports international numbers. Using this method with a number that does not support sending SMS messages results in an error being logged.
See also: Advanced configuration for SMS.
| Name | Type | Description |
|---|---|---|
| phoneNumber | String | The E.164-compliant phone number to send the message to. |
| smsBody | String | The message to send, maximum 1600 characters. |
| source | GlideRecord | The source record to associate with this SMS message. |
| Type | Description |
|---|---|
| void |
var source = new GlideRecord("my_table");
source.query("my_field", "my_value");
if (source.hasNext() && source.next()) {
// send a text message
var nn = new SNC.NotifyNow();
var message = "this is just a test";
var number = "+31612345678";
nn.sendSMS(number, message, source);
}
This example uses dot-walking and the current record as the source record.
new SNC.NotifyNow().sendSMS("+31612345678", "this is a test", current);