This API sends an email. The NodeMailer SMTP transport details must be specified under the mailTransport configuration property or in your Profound.js Spaces mail-config.json file.
Parameter
- Email data object containing the following properties:
from - The email address of the sender. All email addresses can be plain ‘sender@server.com’ or formatted '“Sender Name” sender@server.com’.
to - Comma separated list or an array of recipient email addresses that will appear on the To: field
cc - Comma separated list or an array of recipient email addresses that will appear on the Cc: field
bcc - Comma separated list or an array of recipient email addresses that will appear on the Bcc: field
subject - The subject of the email
text - The plaintext version of the message as an Unicode string, Buffer, Stream or an attachment-like object ({path: ‘/var/data/…'})
html - The HTML version of the message as an Unicode string, Buffer, Stream or an attachment-like object ({path: ‘http://…'})
attachments - An array of attachment objects. Attachments can be used for embedding images as well.
For additional properties and other details, refer to the nodemailer npm package documentation.
Return value
- Information object providing the result from transport mechanism. It may include various properties, such as the messageId. The exact format depends on the transport mechanism used.
pjs.sendEmail{ from: 'Nodemailer <example@nodemailer.com>', to: 'Nodemailer <example@nodemailer.com>', subject: 'Test Email Message', text: 'For clients with plaintext support only', html: `<h1>Thank you for placing your order.</h1> Your order number is ${ordNum}.`, });