# Mailchimp Transactional (Mandrill)

> Send transactional email, manage templates and scheduled messages, and inspect senders and rejections.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/mailchimp-transactional

## Actions

### Add rejection

Add rejection in Mailchimp Transactional (Mandrill).

**Inputs**

- Email (`email`, text, required): An email address to block
- Comment (`comment`, text): An optional comment describing the rejection
- Subaccount (`subaccount`, text): An optional unique identifier for the subaccount to limit the blacklist entry

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "added": false,
    "email": "example"
  }
}
```

### Cancel scheduled message

Cancel scheduled message in Mailchimp Transactional (Mandrill).

**Inputs**

- Id (`id`, text, required): a scheduled email id, as returned by any of the messages/send calls or messages/list-scheduled

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "created_at": "example",
    "from_email": "example",
    "send_at": "example",
    "subject": "example",
    "to": "example"
  }
}
```

### Create template

Create template in Mailchimp Transactional (Mandrill).

**Inputs**

- Name (`name`, text, required): Name for the new template - must be unique
- From email (`from_email`, text): Default sending address for emails sent using this template
- From name (`from_name`, text): Default from name to be used
- Subject (`subject`, text): Default subject line to be used
- Code (`code`, text): HTML code for the template with mc:edit attributes for editable elements
- Text (`text`, text): Default text part to be used when sending with this template
- Publish (`publish`, true/false): Set to false to add a draft template without publishing
- Labels (`labels`, list): Optional array of up to 10 labels to use for filtering templates

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "code": "example",
    "created_at": "example",
    "draft_updated_at": "example",
    "from_email": "example",
    "from_name": "example",
    "is_broken_template": false,
    "labels": [],
    "name": "example",
    "publish_code": "example",
    "publish_from_email": "example",
    "publish_from_name": "example",
    "publish_name": "example",
    "publish_subject": "example",
    "publish_text": "example",
    "published_at": "example",
    "slug": "example",
    "subject": "example",
    "text": "example",
    "updated_at": "example"
  }
}
```

### Delete rejection

Delete rejection in Mailchimp Transactional (Mandrill).

**Inputs**

- Email (`email`, text, required): An email address to remove from the blacklist
- Subaccount (`subaccount`, text): An optional unique identifier for the subaccount to limit the blacklist deletion

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "deleted": false,
    "email": "example",
    "subaccount": "example"
  }
}
```

### Delete template

Delete template in Mailchimp Transactional (Mandrill).

**Inputs**

- Name (`name`, text, required): Immutable slug of an existing template

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "code": "example",
    "created_at": "example",
    "draft_updated_at": "example",
    "from_email": "example",
    "from_name": "example",
    "is_broken_template": false,
    "labels": [],
    "name": "example",
    "publish_code": "example",
    "publish_from_email": "example",
    "publish_from_name": "example",
    "publish_name": "example",
    "publish_subject": "example",
    "publish_text": "example",
    "published_at": "example",
    "slug": "example",
    "subject": "example",
    "text": "example",
    "updated_at": "example"
  }
}
```

### Get account

Get account in Mailchimp Transactional (Mandrill).

**Inputs**: None.

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "backlog": 1,
    "created_at": "example",
    "hourly_quota": 1,
    "public_id": "example",
    "reputation": 1,
    "stats": {
      "all_time": {
        "clicks": 1,
        "complaints": 1,
        "hard_bounces": 1,
        "opens": 1,
        "rejects": 1,
        "sent": 1,
        "soft_bounces": 1,
        "unique_clicks": 1,
        "unique_opens": 1,
        "unsubs": 1
      },
      "last_30_days": {
        "clicks": 1,
        "complaints": 1,
        "hard_bounces": 1,
        "opens": 1,
        "rejects": 1,
        "sent": 1,
        "soft_bounces": 1,
        "unique_clicks": 1,
        "unique_opens": 1,
        "unsubs": 1
      },
      "last_60_days": {
        "clicks": 1,
        "complaints": 1,
        "hard_bounces": 1,
        "opens": 1,
        "rejects": 1,
        "sent": 1,
        "soft_bounces": 1,
        "unique_clicks": 1,
        "unique_opens": 1,
        "unsubs": 1
      },
      "last_7_days": {
        "clicks": 1,
        "complaints": 1,
        "hard_bounces": 1,
        "opens": 1,
        "rejects": 1,
        "sent": 1,
        "soft_bounces": 1,
        "unique_clicks": 1,
        "unique_opens": 1,
        "unsubs": 1
      },
      "last_90_days": {
        "clicks": 1,
        "complaints": 1,
        "hard_bounces": 1,
        "opens": 1,
        "rejects": 1,
        "sent": 1,
        "soft_bounces": 1,
        "unique_clicks": 1,
        "unique_opens": 1,
        "unsubs": 1
      },
      "today": {
        "clicks": 1,
        "complaints": 1,
        "hard_bounces": 1,
        "opens": 1,
        "rejects": 1,
        "sent": 1,
        "soft_bounces": 1,
        "unique_clicks": 1,
        "unique_opens": 1,
        "unsubs": 1
      }
    },
    "username": "example"
  }
}
```

### Get message

Get message in Mailchimp Transactional (Mandrill).

**Inputs**

- Id (`id`, text, required): the unique id of the message to get - passed as the "_id" field in webhooks, send calls, or search calls

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "bounce_description": "example",
    "clicks": 1,
    "clicks_detail": [],
    "diag": "example",
    "email": "example",
    "mc_template": "example",
    "metadata": "example",
    "opens": 1,
    "opens_detail": [],
    "reject": "example",
    "resends": [],
    "sender": "example",
    "smtp_events": [],
    "state": "example",
    "subaccount": "example",
    "subject": "example",
    "tags": [],
    "template": "example",
    "ts": 1
  }
}
```

### Get template

Get template in Mailchimp Transactional (Mandrill).

**Inputs**

- Name (`name`, text, required): Immutable name of an existing template

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "code": "example",
    "created_at": "example",
    "draft_updated_at": "example",
    "from_email": "example",
    "from_name": "example",
    "is_broken_template": false,
    "labels": [],
    "name": "example",
    "publish_code": "example",
    "publish_from_email": "example",
    "publish_from_name": "example",
    "publish_name": "example",
    "publish_subject": "example",
    "publish_text": "example",
    "published_at": "example",
    "slug": "example",
    "subject": "example",
    "text": "example",
    "updated_at": "example"
  }
}
```

### List rejections

List rejections in Mailchimp Transactional (Mandrill).

**Inputs**

- Email (`email`, text): An optional email address to search by
- Include expired (`include_expired`, true/false): Whether to include rejections that have already expired
- Subaccount (`subaccount`, text): An optional unique identifier for the subaccount to limit the blacklist

**Outputs**

- `data` (list): Mailchimp Transactional (Mandrill) response data.
- `has_more` (true/false): Whether another page is available.
- `may_be_truncated` (true/false): The API result limit was reached; narrow the search to ensure complete results.
- `next_cursor` (text): Pass this value to the next page input.
- `records` (list): The records on this page.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "may_be_truncated": false,
  "next_cursor": null,
  "records": []
}
```

### List scheduled messages

List scheduled messages in Mailchimp Transactional (Mandrill).

**Inputs**

- To (`to`, text): an optional recipient address to restrict results to

**Outputs**

- `data` (list): Mailchimp Transactional (Mandrill) response data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Pass this value to the next page input.
- `records` (list): The records on this page.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null,
  "records": []
}
```

### List senders

List senders in Mailchimp Transactional (Mandrill).

**Inputs**: None.

**Outputs**

- `data` (list): Mailchimp Transactional (Mandrill) response data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Pass this value to the next page input.
- `records` (list): The records on this page.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null,
  "records": []
}
```

### List sending domains

List sending domains in Mailchimp Transactional (Mandrill).

**Inputs**: None.

**Outputs**

- `data` (list): Mailchimp Transactional (Mandrill) response data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Pass this value to the next page input.
- `records` (list): The records on this page.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null,
  "records": []
}
```

### List tags

List tags in Mailchimp Transactional (Mandrill).

**Inputs**: None.

**Outputs**

- `data` (list): Mailchimp Transactional (Mandrill) response data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Pass this value to the next page input.
- `records` (list): The records on this page.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null,
  "records": []
}
```

### List templates

List templates in Mailchimp Transactional (Mandrill).

**Inputs**

- Label (`label`, text): Optional label to filter the templates

**Outputs**

- `data` (list): Mailchimp Transactional (Mandrill) response data.
- `has_more` (true/false): Whether another page is available.
- `next_cursor` (text): Pass this value to the next page input.
- `records` (list): The records on this page.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "next_cursor": null,
  "records": []
}
```

### Render template

Render template in Mailchimp Transactional (Mandrill).

**Inputs**

- Template name (`template_name`, text, required): Immutable name or slug of a template that exists in the user's account
- Template content (`template_content`, list, required): Array of template content to render
- Merge vars (`merge_vars`, list): Optional merge variables to use for injecting merge field content

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "html": "example"
  }
}
```

### Reschedule message

Reschedule message in Mailchimp Transactional (Mandrill).

**Inputs**

- Id (`id`, text, required): a scheduled email id, as returned by any of the messages/send calls or messages/list-scheduled
- Send at (`send_at`, date and time, required): the new UTC timestamp when the message should sent. Mandrill can't time travel, so if you specify a time in past the message will be sent immediately

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "_id": "example",
    "created_at": "example",
    "from_email": "example",
    "send_at": "example",
    "subject": "example",
    "to": "example"
  }
}
```

### Search messages

Search messages in Mailchimp Transactional (Mandrill).

**Inputs**

- Query (`query`, text): search terms to find matching messages
- Date from (`date_from`, date): start date
- Date to (`date_to`, date): end date
- Tags (`tags`, list): an array of tag names to narrow the search to
- Senders (`senders`, list): an array of sender addresses to narrow the search to
- Api keys (`api_keys`, list): an array of API keys to narrow the search to
- Limit (`limit`, number): the maximum number of results to return, defaults to 100, upper limit of 1000. At most 1000. Default: `100`.

**Outputs**

- `data` (list): Mailchimp Transactional (Mandrill) response data.
- `has_more` (true/false): Whether another page is available.
- `may_be_truncated` (true/false): The API result limit was reached; narrow the search to ensure complete results.
- `next_cursor` (text): Pass this value to the next page input.
- `records` (list): The records on this page.

**Example output**

```json
{
  "data": [],
  "has_more": false,
  "may_be_truncated": false,
  "next_cursor": null,
  "records": []
}
```

### Send message

Send message in Mailchimp Transactional (Mandrill).

**Inputs**

- Html (`html`, text): the full HTML content to be sent
- Text (`text`, text): optional full text content to be sent
- Subject (`subject`, text): the message subject
- From email (`from_email`, text, required): the sender email address
- From name (`from_name`, text): optional from name to be used
- To (`to`, list, required): an array of recipient information.
- Track opens (`track_opens`, true/false): whether or not to turn on open tracking for the message
- Track clicks (`track_clicks`, true/false): whether or not to turn on click tracking for the message
- Merge language (`merge_language`, text): the merge tag language to use when evaluating merge tags, either mailchimp or handlebars Possible values: "mailchimp" or "handlebars". One of: `mailchimp`, `handlebars`.
- Global merge vars (`global_merge_vars`, list): global merge variables to use for all recipients. You can override these per recipient.
- Merge vars (`merge_vars`, list): per-recipient merge variables, which override global merge variables with the same name.
- Tags (`tags`, list): an array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and will cause errors.
- Metadata (`metadata`, object): metadata an associative array of user metadata. Mandrill will store this metadata and make it available for retrieval. In addition, you can select up to 10 metadata fields to index and make searchable using the Mandrill search api.
- Attachments (`attachments`, list): an array of supported attachments to add to the message
- Async mode (`async_mode`, true/false): enable a background sending mode that is optimized for bulk sending. In async mode, messages/send will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
- Ip pool (`ip_pool`, text): the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.
- Send at (`send_at`, date and time): when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately; for future dates, you're limited to one year from the date of scheduling.

**Outputs**

- `data` (list): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": []
}
```

### Send template

Send template in Mailchimp Transactional (Mandrill).

**Inputs**

- Template name (`template_name`, text, required): the immutable slug of a template that exists in the user's account. Make sure you don't use the template name as this one might change.
- Template content (`template_content`, list, required): an array of template content to send. Each item in the array should be a struct with two keys - name: the name of the content block to set the content for, and content: the actual content to put into the block
- Html (`html`, text): the full HTML content to be sent
- Text (`text`, text): optional full text content to be sent
- Subject (`subject`, text): the message subject
- From email (`from_email`, text, required): the sender email address
- From name (`from_name`, text): optional from name to be used
- To (`to`, list, required): an array of recipient information.
- Track opens (`track_opens`, true/false): whether or not to turn on open tracking for the message
- Track clicks (`track_clicks`, true/false): whether or not to turn on click tracking for the message
- Merge language (`merge_language`, text): the merge tag language to use when evaluating merge tags, either mailchimp or handlebars Possible values: "mailchimp" or "handlebars". One of: `mailchimp`, `handlebars`.
- Global merge vars (`global_merge_vars`, list): global merge variables to use for all recipients. You can override these per recipient.
- Merge vars (`merge_vars`, list): per-recipient merge variables, which override global merge variables with the same name.
- Tags (`tags`, list): an array of string to tag the message with. Stats are accumulated using tags, though we only store the first 100 we see, so this should not be unique or change frequently. Tags should be 50 characters or less. Any tags starting with an underscore are reserved for internal use and will cause errors.
- Metadata (`metadata`, object): metadata an associative array of user metadata. Mandrill will store this metadata and make it available for retrieval. In addition, you can select up to 10 metadata fields to index and make searchable using the Mandrill search api.
- Attachments (`attachments`, list): an array of supported attachments to add to the message
- Async mode (`async_mode`, true/false): enable a background sending mode that is optimized for bulk sending. In async mode, messages/send will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
- Ip pool (`ip_pool`, text): the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.
- Send at (`send_at`, date and time): when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately; for future dates, you're limited to one year from the date of scheduling.

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {}
}
```

### Update template

Update template in Mailchimp Transactional (Mandrill).

**Inputs**

- Name (`name`, text, required): Immutable name of an existing template
- From email (`from_email`, text): New default sending address
- From name (`from_name`, text): New default from name
- Subject (`subject`, text): New default subject line
- Code (`code`, text): New code for the template
- Text (`text`, text): New default text part to be used
- Publish (`publish`, true/false): Set to false to update the draft version without publishing
- Labels (`labels`, list): Optional array of up to 10 labels to use for filtering templates

**Outputs**

- `data` (object): Mailchimp Transactional (Mandrill) response data.

**Example output**

```json
{
  "data": {
    "code": "example",
    "created_at": "example",
    "draft_updated_at": "example",
    "from_email": "example",
    "from_name": "example",
    "is_broken_template": false,
    "labels": [],
    "name": "example",
    "publish_code": "example",
    "publish_from_email": "example",
    "publish_from_name": "example",
    "publish_name": "example",
    "publish_subject": "example",
    "publish_text": "example",
    "published_at": "example",
    "slug": "example",
    "subject": "example",
    "text": "example",
    "updated_at": "example"
  }
}
```
