Skip to main content

Service Task — Send Email ✉️

Sends an email message via a configured mail provider.

Node type: serviceTask (subtype: Send Email) Category: Integration Actor: serviceTask (2 threads)


Description

The Email Service Task sends email messages through a configured mail integration (Mailjet, SendGrid, SMTP, or Amazon SES). All recipient addresses, subject lines, and body content support {varName} variable substitution.


Properties

PropertyTypeRequiredDescription
mailConnectionIdstringYesID of the Email integration
recipientAddresstextYesRecipient email address. Supports {varName} (e.g., {customerEmail})
subjecttextYesEmail subject line. Supports {varName}
bodytextareaYesEmail body. Supports {varName}. HTML or plain text based on contentType
contentTypeselectNotext/plain (default) or text/html
attachmentsfileUploadNoStatic file attachments (uploaded at design time)

Inputs

All properties support {varName} substitution:

recipientAddress: {customerEmail}
subject: Your support ticket {ticketId} has been updated
body: Dear {customerName},

Your ticket #{ticketId} regarding "{issueType}" has been reviewed.

Our team's response: {agentResponse}

Best regards,
{agentName}
Support Team

Outputs

VariableTypeDescription
{emailSent}booleantrue if the email was delivered successfully
{emailMessageId}stringProvider-assigned message ID for tracking

Connections

ConditionConnection
Email sent successfullysuccessFlow or sequenceFlow
Email send failederrorFlow
TimeouttimeoutFlow

Example: Send Confirmation Email

{
"nodeId": "send-confirm-email",
"name": "Send Order Confirmation",
"nodeType": "serviceTask",
"properties": {
"mailConnectionId": "int_mailjet_prod",
"recipientAddress": "{customerEmail}",
"subject": "Order #{orderId} Confirmed",
"body": "<h2>Thank you for your order!</h2><p>Hi {customerName},</p><p>Your order #{orderId} for ${orderTotal} has been confirmed and will ship within 2 business days.</p>",
"contentType": "text/html"
},
"timeout": {
"duration": 30,
"durationUom": "SECONDS",
"action": "FAIL"
}
}

Multiple Recipients

To send to multiple recipients, use a comma-separated list or iterate with a Loop node:

recipientAddress: {primaryEmail}, {ccEmail}

Or use a Loop node over an array of email addresses.


HTML Email Tips

When using contentType: text/html:

  • Inline CSS styles for maximum email client compatibility
  • Test in multiple email clients (Gmail, Outlook, Apple Mail)
  • Variable substitution works inside HTML tags: <strong>{customerName}</strong>
  • To avoid encoding issues, use {varName} directly — the engine HTML-escapes values automatically in text nodes

Supported Mail Providers

Configure via an Email Integration:

ProviderNotes
MailjetTransactional email API, high deliverability
SendGridTwilio's email API, templates supported
SMTPGeneric SMTP — works with Gmail, Office 365, custom servers
Amazon SESAWS email service — very low cost at scale

Error Handling

ErrorCause
550 Invalid recipientBad email address — validate before sending
Authentication failureCheck mail integration credentials
Daily send limit exceededProvider rate limit — use retry with delay
Connection timeoutSMTP server unreachable — configure timeout and retry

Best Practices

  • Validate {customerEmail} before sending — use a Script Task or If/Else to check it's non-null
  • Set a timeout (30 seconds) — SMTP connections can hang
  • Always connect an errorFlow to handle failed sends gracefully
  • For bulk sending, use a Loop node and add delay to avoid provider rate limits
  • Use text/html for formatted emails; text/plain for plain notifications and alerts