Skip to content

SMS Services

SMS services are used to define integrations with SMS providers, allowing the Emakin system to send SMS messages.

Messages are attempted to be sent through each configured SMS service in the order they are listed. The first SMS service that returns a non-null value and does not result in an error will be considered successful.

Is Enabled

Specifies whether the service is currently enabled or not.

Name

A name to identify the service.

SMS Gateway Code

An integration script for invoking the SMS service.

The integration script is called with the following predefined variables:

Variable Name Description
$Destination The phone number to which the SMS message is to be sent.
$Message The content of the SMS message.
$Service The reason for sending the SMS (e.g., 2FA).
$Code The 2FA verification code, if applicable.

The script content will vary depending on the specific SMS service. Here's an example:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
var client = $Rest.Create('http://mysmsservice');

var request = client.Request('send');

request.AddObject({
    To: $Destination,
    Text: $Message
});

var reply = request.ExecuteJson();

if (!reply.IsSucceed)
    throw new Error('SMS send failed');