Skip to content

SMS Services

SMS Services defines integrations with SMS providers so Emakin can send text messages for scenarios such as 2FA or other notification flows.

Open Messaging and Automation → SMS Services.

Delivery Behavior

Emakin evaluates enabled SMS services that contain gateway code in listed order. The first script is normally the deciding service: a non-null result reports success and a null result reports failure. Emakin proceeds to the next configured script only when the current script throws an error.

If no configured script is available, or every attempted script throws an error, Emakin sends the request to the application's global mobile-push SMS endpoint. A normal null result does not trigger this fallback.

Settings Reference

Is Enabled

Controls whether the SMS service is active.

Name

Service name used for identification.

SMS Gateway Code

Integration script used to call the SMS provider.

Available predefined variables are:

Variable Name Description
$Destination Destination phone number
$Message SMS message content
$Service Reason for sending, such as 2FA
$Code Verification code, when applicable
$ActiveUser Identity proxy for the user associated with the SMS request
$Culture Culture of the active user context

$Code is defined only when the SMS request includes a verification code.

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');