Cloudhooks Help

email.send

Sends an email with either HTML or plain text.

Parameters

A config object is passed to the function with the following properties:

ParameterDescription
fromSender's email address (Optional)
toRecipient's email address
subjectEmail's subject
ccArray of cc recipients' emails
bodyEmail 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
attachmentAttachment data (Optional)
attachmentNameFile name of the attachment. Defaults to 'file'

Returns

Promise that is resolved with no data.

Examples

Sends an email about a new order

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}.`
	});
}