ftos.messaging.sendEmail
IMPORTANT!
Starting with v24.3.0, this is renamed from server.messaging.sendEmail to ftos.messaging.sendEmail.
Starting with v24.3.0, this is renamed from server.messaging.sendEmail to ftos.messaging.sendEmail.
Sends a message (sms/email) containing the server generated OTP and returns the requestId to be used by other methods.
This is suitable for business logic modules of business service components.
Syntax
Copy
function ftos.messaging.sendEmail(to, from, message, {"provider": "FtosEmailNotificationService","subject": "test subject","cc":'[“a“,”b”]',"bcc":'[“x“,”y”]'})
| Parameter | Type | Description |
|---|---|---|
from
|
string | Email address/Phone number of the sender. |
to
|
string | Email address/Phone number of the recipient(s). |
subject |
string | Email subject (used only if the OTP is sent to an email address). |
notificationProvider
|
string |
A string defining the provider which will be used to send the email/sms. The following providers are supported: GatewayEmailOTP, CustomEmailProvider and FtosEmailNotificationService. |
notificationChannel
|
string |
The channel(sms/email) provider which will be used to send the OTP. |
Examples
In this example:
- We send an email to jane.smith@mail.com.
- The message reads: Your next payment due date is 25/02/2022..
- The message sender is MyBusiness Ltd.
- The message is sent immediately using the email service provider (GatewayEmailOTP).
Copy
ftos.messaging.sendEmail("jane.smith@mail.com", "MyBusiness Ltd.", "Your next payment due date is 25/02/2022.", {"provider": "GatewayEmailOTP","subject": "Payment Due Date"})