Reference · Tools

Mandrill

Send transactional emails via the Mandrill (Mailchimp Transactional) API with support for templates, HTML, merge variables, and binary file attachments.

Action (binary) Communication v1 Binary data

The Mandrill node sends transactional email through Mailchimp Transactional, supporting templates, raw HTML, merge variables and binary attachments. A typical build is sending a receipt from a Mandrill template with per-customer merge variables and the PDF attached.

Node type
Action (binary)
Parameters
16
Outputs
Output, Error
Credentials
Mandrill API

Mandrill

Send transactional emails via Mandrill API with templates and attachments

Overview

The Mandrill tool sends transactional emails through the Mandrill API (Mailchimp Transactional Email). It supports two operations: (1) sendHtml — send an email with raw HTML content, and (2) sendTemplate — send an email using a pre-defined Mandrill template with merge variable substitution. Both operations support binary file attachments from upstream items. Supports tracking, metadata, merge variables, scheduling, subaccounts, Google Analytics integration, and custom email headers.

Category: Communication
Tool Name: mandrill
Version: 1

Appearance: Icon: lucide-Mail | Color: #FFD94C

Node Type

Action (Binary) — handles file/binary data operations

Input / Output

DirectionPort(s)
InputInput
OutputOutput, Error

Credentials

This tool requires Mandrill API credentials. See the Credentials Guide for setup instructions.

Resources

ResourceValue
Messagemessage

Operations

OperationValueDescription
Send TemplatesendTemplateSend message based on a Mandrill template
Send HTMLsendHtmlSend message based on raw HTML content

Parameters

Send HTML takes no parameters of its own — see All Operations, and put the body in Options → HTML.

Message: Send Template

ParameterTypeRequiredDefaultDescription
TemplatestringYesThe template slug to use. Find template slugs in the Mandrill dashboard under Outbound > Templates. Supports expressions.

All Operations

ParameterTypeRequiredDefaultDescription
From EmailstringYesEmail address of the sender, optionally with name: “Name <email>”. Supports expressions.
To EmailstringYesEmail address of the recipient. Multiple addresses can be separated by commas. Supports expressions like {{ $json.email }}.
JSON ParametersbooleanNofalseWhether to provide merge vars, metadata, headers, and attachments as raw JSON strings instead of UI fields.
OptionscollectionNo{}The message body plus every delivery, tracking and content setting.
— AsyncbooleanNofalseWhether to enable background sending mode optimized for bulk sending. Messages with more than 10 recipients are always sent asynchronously.
— Auto TextbooleanNofalseWhether to automatically generate a text part for messages that are not given text.
— Auto HTMLbooleanNofalseWhether to automatically generate an HTML part for messages that are not given HTML.
— BCC AddressstringNoAn optional address to receive an exact copy of each recipient’s email. Supports expressions.
— From NamestringNoOptional from name to be used. Supports expressions.
— Google Analytics CampaignstringNoValue to set for the utm_campaign tracking parameter. If not provided the email’s from address will be used.
— Google Analytics DomainsstringNoComma-separated domains for which matching URLs will have Google Analytics parameters appended automatically.
— HTMLstringNoThe HTML content of the email. Supports expressions.
— ImportantbooleanNofalseWhether this message is important and should be delivered ahead of non-important messages.
— Inline CSSbooleanNofalseWhether to automatically inline all CSS styles in the HTML. Only for HTML documents less than 256KB.
— IP PoolstringNoThe name of the dedicated IP pool to use. If not set or pool does not exist, the default pool is used.
— Preserve RecipientsbooleanNofalseWhether to expose all recipients in the To header for each email.
— Return Path DomainstringNoA custom domain to use for the message’s return-path.
— Send AtdateTimeNoScheduled send time as UTC timestamp (YYYY-MM-DD HH:MM:SS). Past times send immediately. Additional fee applies.
— Signing DomainstringNoA custom domain to use for SPF/DKIM signing instead of mandrill.
— SubaccountstringNoThe unique ID of a subaccount for this message. Must already exist or will fail with an error.
— SubjectstringNoSubject line of the email. Supports expressions.
— TagsstringNoComma-separated tags for the message. Max 100 unique tags, max 50 chars each. Tags starting with ”_” are reserved.
— TextstringNoThe plain text content of the email. Supports expressions.
— Track ClicksbooleanNofalseWhether to turn on click tracking for the message.
— Track OpensbooleanNofalseWhether to turn on open tracking for the message.
— Tracking DomainstringNoA custom domain to use for tracking opens and clicks instead of mandrillapp.com.
— URL Strip QSbooleanNofalseWhether to strip the query string from URLs when aggregating tracked URL data.
— View Content LinkbooleanNofalseWhether to remove content logging for sensitive emails.
Merge Vars (mergeVarsJson)jsonNoGlobal merge variables as a JSON array of {name, content} objects. (shown when JSON Parameters is true)
Metadata (metadataJson)jsonNoMetadata as a JSON object of key-value pairs. Up to 10 fields are searchable via Mandrill search API. (shown when JSON Parameters is true)
Attachments (attachmentsJson)jsonNoAttachments as a JSON array of {type, name, content} objects where content is base64-encoded. (shown when JSON Parameters is true)
Headers (headersJson)jsonNoCustom email headers as a JSON object. Most headers are allowed. (shown when JSON Parameters is true)
Merge Vars (mergeVarsUi)fixedCollectionNo{}Global merge variables for template substitution. (shown when JSON Parameters is false)
— NamestringNoMerge variable name (e.g., FNAME).
— ContentstringNoMerge variable content value. Supports expressions.
Metadata (metadataUi)fixedCollectionNo{}Custom metadata key-value pairs. Up to 10 fields are searchable via Mandrill search API. (shown when JSON Parameters is false)
— NamestringNoMetadata key name.
— ValuestringNoMetadata value. Supports expressions.
Attachments (attachmentsUi)fixedCollectionNo{}File attachments. Add manual base64 attachments or reference binary properties from upstream nodes. (shown when JSON Parameters is false)
— MIME TypestringNoThe MIME type of the attachment. Part of a Manual Attachment entry.
— File NamestringNoThe file name of the attachment. Part of a Manual Attachment entry.
— Content (Base64)stringNoThe content of the attachment as a base64-encoded string. Part of a Manual Attachment entry.
— Binary PropertystringNodataName of the binary property containing data to attach to the email. Part of a Binary Attachment entry.
Headers (headersUi)fixedCollectionNo{}Custom email headers (most headers are allowed). (shown when JSON Parameters is false)
— NamestringNoHeader name (e.g., Reply-To).
— ValuestringNoHeader value. Supports expressions.
Max ConcurrencynumberNo10Maximum number of items to process concurrently.

Output Data

One email per input item and one output item per input item — this node never fans out, even when To Email lists several recipients. The Mandrill result is written to mandrillResponse on the output item; the rest of the item JSON passes through unchanged and binary data is forwarded.

{
  "mandrillResponse": []
}

mandrillResponse holds Mandrill’s send result exactly as returned — an array with one entry per recipient the message was addressed to. Address a single recipient’s result as {{ $json.mandrillResponse[0] }}, and use a Split Out node on mandrillResponse if you want one workflow item per recipient.

Attachments. Two routes reach the same place: name an upstream binary property in an Attachments → Binary Attachment entry, or supply base64 content yourself in a Manual Attachment entry (or in Attachments as JSON when JSON Parameters is on).

Usage Examples

  • Send an HTML email with a PDF attachment via Mandrill
  • Send a template-based email with merge variables
  • Send bulk transactional emails with tracking enabled
  • Send email with binary file attachments from upstream nodes
  • Send a scheduled email for later delivery

Example Configuration

Send an HTML email — note that the body lives in Options:

{
  "type": "mandrill",
  "parameters": {
    "resource": "message",
    "operation": "sendHtml",
    "fromEmail": "sender@example.com",
    "toEmail": "recipient@example.com",
    "jsonParameters": false,
    "options": {
      "subject": "Welcome to Our Service",
      "html": "<h1>Welcome!</h1><p>Thank you for joining us.</p>",
      "text": "Welcome! Thank you for joining us.",
      "fromName": "Welcome Team",
      "trackOpens": true,
      "trackClicks": true
    }
  }
}

Send a template email with merge variables and metadata entered as UI fields:

{
  "type": "mandrill",
  "parameters": {
    "resource": "message",
    "operation": "sendTemplate",
    "template": "welcome-template",
    "fromEmail": "Welcome Team <welcome@example.com>",
    "toEmail": "{{ $json.email }}",
    "jsonParameters": false,
    "options": {
      "subject": "Welcome {{ $json.firstName }}!",
      "fromName": "Customer Success",
      "trackOpens": true,
      "important": true,
      "tags": "welcome,onboarding"
    },
    "mergeVarsUi": {
      "mergeVarsValues": [
        {
          "name": "FNAME",
          "content": "{{ $json.firstName }}"
        },
        {
          "name": "COMPANY",
          "content": "{{ $json.company }}"
        }
      ]
    },
    "metadataUi": {
      "metadataValues": [
        {
          "name": "user_id",
          "value": "{{ $json.userId }}"
        },
        {
          "name": "signup_source",
          "value": "website"
        }
      ]
    }
  }
}

Send an email with an attachment, with merge vars, attachments and headers supplied as JSON:

{
  "type": "mandrill",
  "parameters": {
    "resource": "message",
    "operation": "sendHtml",
    "fromEmail": "orders@example.com",
    "toEmail": "customer@example.com",
    "jsonParameters": true,
    "options": {
      "subject": "Your Order Invoice #12345",
      "html": "<h1>Order Complete</h1><p>Please find your invoice attached.</p>",
      "fromName": "Order Processing",
      "trackOpens": true
    },
    "mergeVarsJson": "[{\"name\": \"ORDER_ID\", \"content\": \"12345\"}, {\"name\": \"TOTAL\", \"content\": \"$149.99\"}]",
    "attachmentsJson": "[{\"type\": \"application/pdf\", \"name\": \"invoice-12345.pdf\", \"content\": \"JVBERi0xLjQKJcOkw7zDtsOuw6A\"}]",
    "headersJson": "{\"Reply-To\": \"support@example.com\", \"X-Order-ID\": \"12345\"}"
  }
}

Scheduled email with custom tracking:

{
  "type": "mandrill",
  "parameters": {
    "resource": "message",
    "operation": "sendTemplate",
    "template": "monthly-report",
    "fromEmail": "reports@example.com",
    "toEmail": "admin@example.com,manager@example.com",
    "jsonParameters": false,
    "options": {
      "subject": "Monthly Performance Report",
      "sendAt": "2024-12-01T09:00:00Z",
      "trackOpens": true,
      "trackClicks": true,
      "trackingDomain": "tracking.example.com",
      "tags": "reports,monthly,automated",
      "preserveRecipients": false,
      "important": true
    },
    "mergeVarsUi": {
      "mergeVarsValues": [
        {
          "name": "MONTH",
          "content": "November 2024"
        },
        {
          "name": "REVENUE",
          "content": "$45,230"
        }
      ]
    }
  }
}

Attach a file that an upstream node downloaded, without touching base64:

{
  "type": "mandrill",
  "parameters": {
    "resource": "message",
    "operation": "sendHtml",
    "fromEmail": "reports@example.com",
    "toEmail": "{{ $json.email }}",
    "jsonParameters": false,
    "options": {
      "subject": "Your report is ready",
      "html": "<p>The report is attached.</p>"
    },
    "attachmentsUi": {
      "attachmentsBinary": [
        {
          "property": "data"
        }
      ]
    }
  }
}

Error Handling

ModeBehavior
stopHalts workflow on first error
continueSkips failed items, passes successful ones through
errorPortRoutes failed items to Error output port

Tips

Send transactional emails via Mandrill API with templates, HTML, merge variables, and binary attachments.

Key Notes

  • The body lives in Options. There is no top-level HTML or Subject field — open Options and add HTML, Text and Subject there, for both operations.
  • JSON Parameters switches the whole panel. With it off you get the four UI builders (Merge Vars, Metadata, Attachments, Headers); with it on you get the four raw-JSON fields instead. The two sets never appear together, so pick one style per node.
  • Braces belong to the workflow, not to Mandrill. Anything you type as {{ … }} is evaluated as a workflow expression before Mandrill sees it, and only $json, $index, $itemCount, $datetime and $uuid are understood. Personalise from item data with {{ $json.firstName }}, and pass template placeholders through Merge Vars rather than writing them into the subject or body.
  • Template Send needs a slug, not a name. Copy it from Outbound > Templates in the Mandrill dashboard.
  • Send At is a paid extra on Mandrill, and a timestamp in the past sends straight away.

Frequently asked questions

Where are the Subject and HTML fields?

Inside Options. There is no top-level HTML or Subject field — open Options and add HTML, Text and Subject there, for both operations. This surprises most people configuring it for the first time.

What does the JSON Parameters toggle change?

It swaps the whole panel. Off gives you the four UI builders for Merge Vars, Metadata, Attachments and Headers; on gives you the four raw-JSON fields instead. The two sets never appear together, so pick one style per node.

Why is my merge syntax being evaluated?

Braces belong to the workflow: `{{ … }}` is resolved as a workflow expression before Mandrill receives the content. Use workflow expressions for per-item values rather than expecting Mandrill's own syntax to survive.

Can it send attachments?

Yes — binary file attachments are supported, so a document produced upstream can be attached to the message.

Build with the Mandrill node

Drop it into a workflow, wire it to an agent, or call it on a schedule. You'll need Mandrill API credentials first.

Open BusyBot

Last updated . Spotted something wrong? Tell us.