Sends an email with either HTML or plain text.
Parameters
A config object is passed to the function with the following properties:
from |
Sender's email address (Optional) |
to |
Recipient's email address |
subject |
Email's subject |
cc |
Array of cc recipients' emails |
body |
Email message It will be recognized as a HTML email if it contains any of the following tags: div, p, a, strong, h1, h2, h3, h4, h5, h6 |
attachment |
Attachment data (Optional) |
attachmentName |
File name of the attachment. Defaults to 'file' |
Returns
Promise that is resolved with no data.
Examples
module.exports = async function(payload, actions, context) {
await actions.emails.send({
to: '[email protected]',
cc: [ '[email protected]', '[email protected]' ],
subject: 'Just a note',
body: `Hi!
Let me know what you think about ${payload.customer.email}.`
});
}