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
| Property | Type | Required | Description |
|---|---|---|---|
mailConnectionId | string | Yes | ID of the Email integration |
recipientAddress | text | Yes | Recipient email address. Supports {varName} (e.g., {customerEmail}) |
subject | text | Yes | Email subject line. Supports {varName} |
body | textarea | Yes | Email body. Supports {varName}. HTML or plain text based on contentType |
contentType | select | No | text/plain (default) or text/html |
attachments | fileUpload | No | Static 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
| Variable | Type | Description |
|---|---|---|
{emailSent} | boolean | true if the email was delivered successfully |
{emailMessageId} | string | Provider-assigned message ID for tracking |
Connections
| Condition | Connection |
|---|---|
| Email sent successfully | successFlow or sequenceFlow |
| Email send failed | errorFlow |
| Timeout | timeoutFlow |
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:
| Provider | Notes |
|---|---|
| Mailjet | Transactional email API, high deliverability |
| SendGrid | Twilio's email API, templates supported |
| SMTP | Generic SMTP — works with Gmail, Office 365, custom servers |
| Amazon SES | AWS email service — very low cost at scale |
Error Handling
| Error | Cause |
|---|---|
550 Invalid recipient | Bad email address — validate before sending |
Authentication failure | Check mail integration credentials |
Daily send limit exceeded | Provider rate limit — use retry with delay |
Connection timeout | SMTP 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
errorFlowto handle failed sends gracefully - For bulk sending, use a Loop node and add delay to avoid provider rate limits
- Use
text/htmlfor formatted emails;text/plainfor plain notifications and alerts