Skip to content

Rule Effect

sendEmail

Back to Index

Return this effect to queue an email for delivery through the Sendings system.

Type

{
effect: 'sendEmail'
to: text
subject: text
body: {
plainText: text | nothing
html: text | nothing
}
cc: [text] | nothing
bcc: [text] | nothing
from: text | nothing
fromName: text | nothing
replyTo: text | nothing
category: text | nothing
dynamic: {text->text} | nothing
}

Fields

FieldTypeRequiredDescription
effect'sendEmail'YesMust be 'sendEmail'
totextYesRecipient email address
subjecttextYesEmail subject line
bodyrecordYesEmail body (at least one of plainText or html required)
body.plainTexttextNoPlain text version of the email
body.htmltextNoHTML version of the email
cc[text]NoCC recipients
bcc[text]NoBCC recipients
fromtextNoSender email address (uses system default if not specified)
fromNametextNoSender display name
replyTotextNoReply-to email address
categorytextNoEmail category for tracking (defaults to 'rule')
dynamic{text->text}NoCustom metadata/tracking data

Example

param input: OnOrderCreated
from {
effect = 'sendEmail'
to = input.order.invoiceAddress.email
subject = 'Order Confirmation - ' + input.order.orderNumber
body = {
plainText = 'Thank you for your order!'
html = '<h1>Thank you for your order!</h1><p>Order number: ' + input.order.orderNumber + '</p>'
}
category = 'order-confirmation'
dynamic = {
orderId = input.order.orderId :: text
orderNumber = input.order.orderNumber
}
}

Notes

  • At least one of body.plainText or body.html must be provided
  • Emails are queued for delivery and sent asynchronously
  • The category field defaults to 'rule' if not specified
  • Email delivery status can be tracked via the Sendings Graph Node

See Also

Back to Index