ftos.messaging.sendEmail
Starting with v24.3.0, this is renamed from server.messaging.sendEmail to ftos.messaging.sendEmail.
Sends an email using a recipient email address, a sender email address, and a declared message. It sends an email message from a sender to one or more recipients, with additional settings such as the channel provider passed through an ISendEmailOption object. It returns no value.
This is suitable for business logic modules of business service components.
Syntax
method ftos.messaging.sendEmail(to: any, _from: string, message: string, options: ISendEmailOption): void
| Parameter | Type | Description |
|---|---|---|
|
|
string | Email address of the sender. |
to
|
string | Email address of the recipient(s). |
message
|
string | Message to be sent to recipient. |
options
|
string | A JSON object containing the Subject, CC, BCC, Provider parameter information. |
Examples
In this example:
-
We send an email to john.doe@mail.com.
-
The message reads: Your loan application has been approved. Our team will contact you shortly with the next steps.
-
The message sender is MyBank Ltd.
-
The message is sent immediately using the email service provider (FTOSEmailGateway).
ftos.messaging.sendEmail("john.doe@mail.com", "MyBank Ltd.", "Your loan application has been approved. Our team will contact you shortly with the next steps.", {"provider": "FTOSEmailGateway", "subject": "Loan Application Approved"})