ftos.messaging.sendSMS
Starting with v24.3.0, this is renamed from server.messaging.sendSMS to ftos.messaging.sendSMS.
Sends an SMS message to a specified mobile number using a configured communication provider (such as FtosApiSms).
This is suitable for business logic modules of business service components.
Do not use
GatewaySmsOTP. It is deprecated and must no longer be used. Use an updated provider such as FtosApiSms.Syntax
function ftos.messaging.sendSMS(phoneNumber: string, message: string, options: ISendSMSOption): void
| Parameter | Type | Description |
|---|---|---|
phoneNumber
|
string | Telephone number of the recipient. IMPORTANT! The telephone number must include the country dialing code. |
message
|
string | Contents of the SMS message. |
options
|
object |
|
Return Value
-
void— This method executes the SMS delivery request and does not return a value.
Code Example
This example demonstrates how to send an SMS notification using the FtosApiSms communication provider:
-
Defines the payload: Sets the destination mobile phone number in international format (
+40712345678) and the verification message text. -
Configures the delivery options:
-
Specifies
"FtosTest"as the sender name (from) displayed to the recipient. -
Designates
"FtosApiSms"as the delivery channel (provider), directing the platform to route the message through the service endpoint and credentials defined in theFtosApiSmsProviderconfiguration.
-
-
Dispatches the SMS: Calls
ftos.messaging.sendSMS(...)with the destination, body, and options to trigger message delivery.
const recipient = "+40712345678";
const smsText = "Your verification code is: 482910";
const smsOptions: ISendSMSOption = {
from: "FtosTest",
provider: "FtosApiSms"
};
ftos.messaging.sendSMS(recipient, smsText, smsOptions);