Class: EmailService

EmailService

new EmailService(providers, options)

Create an EmailService instance which tries uses a set of providers to send an Email, one by one, given that the previous one fails..
Parameters:
Name Type Description
providers Array.<EmailServiceProvider> An array of email service providers to be used in the given order.
options Object Additional configuration options
Properties
Name Type Description
logging boolean Enable error logging or not
Source:

Methods

sendEmail(details) → {Promise.<{result: Object, errors: Array.<EmailServiceError>}>}

Function to send an email using the initialized providers.
Parameters:
Name Type Description
details Object Email message options
Properties
Name Type Attributes Description
from string The email address of the sender
to string | Array.<string> Comma separated list or an array of recipients email addresses that will appear on the To: field
cc string | Array.<string> <optional>
Comma separated list or an array of recipients email addresses that will appear on the Cc: field
bcc string | Array.<string> <optional>
Comma separated list or an array of recipients email addresses that will appear on the Bcc: field
subj string <optional>
The subject of the email
text string <optional>
The plaintext version of the message
html string <optional>
he HTML version of the message
Source:
Returns:
- A promise for sending the Email.
Type
Promise.<{result: Object, errors: Array.<EmailServiceError>}>