# MailerSend

> Send transactional email and track its delivery, opens, clicks and bounces, and manage the blocklist.

App · 13 actions. Web page: https://docs.lodol.com/docs/integrations/mailersend

## Actions

### Add to the blocklist

Add addresses or patterns to a MailerSend blocklist, so MailerSend stops sending to them.

**Inputs**

- Email addresses (`recipients`, list): Email addresses to block.
- Patterns (`patterns`, list): Patterns to block, such as `.*@example.com` for a whole domain.
- Domain (`domain_id`, text): The domain whose blocklist to add to. Leave blank to block for every domain in the account.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "id": "example",
        "pattern": "example",
        "type": "exact",
        "updated_at": "example"
      }
    ]
  }
}
```

### Get a sent message

Get a message that Send an email created, with each email it produced (one per recipient) and their delivery status.

**Inputs**

- Message ID (`message_id`, text, required): The message ID that Send an email returned.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": {
      "created_at": "example",
      "domain": {
        "created_at": "example",
        "dkim": true,
        "domain_settings": {
          "custom_tracking_enabled": true,
          "ignore_duplicated_recipients": true,
          "inbound_routing_enabled": true,
          "precedence_bulk": true,
          "send_paused": true,
          "track_clicks": true,
          "track_content": true,
          "track_opens": true,
          "track_unsubscribe": true
        },
        "has_not_queued_messages": true,
        "id": "example",
        "is_cname_active": true,
        "is_cname_verified": true,
        "is_dns_active": true,
        "is_sending_paused": true,
        "is_tracking_allowed": true,
        "is_verified": true,
        "name": "example",
        "not_queued_messages_count": 1,
        "spf": true,
        "tracking": true,
        "updated_at": "example"
      },
      "emails": [
        {
          "created_at": "example",
          "domain_id": "example",
          "from": "example",
          "headers": [
            {
              "name": "example",
              "value": "example"
            }
          ],
          "html": "example",
          "id": "example",
          "interaction": [
            "example"
          ],
          "message_id": "example",
          "status": "queued",
          "subject": "example",
          "suppression_reason": "example",
          "tags": [
            "example"
          ],
          "template_id": "example",
          "text": "example",
          "to": "example",
          "updated_at": "example"
        }
      ],
      "id": "example",
      "updated_at": "example"
    }
  }
}
```

### Get an email

Get one email sent to one recipient, with its content, status and up to 200 of its latest events (delivered, opened, clicked and so on).

**Inputs**

- Email ID (`email_id`, text, required): The ID of the email, from List emails or Get a sent message.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": {
      "activity": [
        {
          "created_at": "example",
          "id": "example",
          "suppression_reason": "example",
          "type": "example"
        }
      ],
      "created_at": "example",
      "domain_id": "example",
      "from": "example",
      "headers": [
        {
          "name": "example",
          "value": "example"
        }
      ],
      "html": "example",
      "id": "example",
      "interaction": [
        "example"
      ],
      "message_id": "example",
      "status": "queued",
      "subject": "example",
      "suppression_reason": "example",
      "tags": [
        "example"
      ],
      "template_id": "example",
      "text": "example",
      "to": "example",
      "updated_at": "example"
    }
  }
}
```

### Get API quota

Get how many MailerSend API requests your account has left today and when the quota resets (midnight UTC). Checking does not use the quota.

**Inputs**: None.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "quota": 1,
    "remaining": 1,
    "reset": "example"
  }
}
```

### List blocklist entries

List the addresses and patterns on a MailerSend blocklist. MailerSend never sends to them.

**Inputs**

- Domain (`domain_id`, text): The domain whose blocklist to list. Leave blank for the account's own blocklist.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): How many results to return per page, from 10 to 100. MailerSend returns 25 when this is blank. From 10 to 100.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "domain": {
          "id": "example",
          "name": "example"
        },
        "id": "example",
        "pattern": "example",
        "type": "exact",
        "updated_at": "example"
      }
    ],
    "links": {
      "next": "example"
    },
    "meta": {
      "current_page": 1,
      "per_page": 1
    }
  }
}
```

### List domains

List the sending domains in your MailerSend account and whether each is verified.

**Inputs**

- Verified (`verified`, true/false): Only list verified domains (on) or only unverified ones (off). Leave blank for both.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): How many results to return per page, from 10 to 100. MailerSend returns 25 when this is blank. From 10 to 100.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "dkim": true,
        "domain_settings": {
          "custom_tracking_enabled": true,
          "ignore_duplicated_recipients": true,
          "inbound_routing_enabled": true,
          "precedence_bulk": true,
          "send_paused": true,
          "track_clicks": true,
          "track_content": true,
          "track_opens": true,
          "track_unsubscribe": true
        },
        "has_not_queued_messages": true,
        "id": "example",
        "is_cname_active": true,
        "is_cname_verified": true,
        "is_dns_active": true,
        "is_sending_paused": true,
        "is_tracking_allowed": true,
        "is_verified": true,
        "name": "example",
        "not_queued_messages_count": 1,
        "spf": true,
        "tracking": true,
        "updated_at": "example"
      }
    ],
    "links": {
      "next": "example"
    },
    "meta": {
      "current_page": 1,
      "per_page": 1
    }
  }
}
```

### List email activity

List a domain's email events in a time range, such as deliveries, opens, clicks and bounces, newest first. Each email appears once per event. MailerSend allows 10 of these and List emails requests a minute between them.

**Inputs**

- Domain (`domain_id`, text, required): The domain whose activity to list.
- From (`date_from`, date and time): The start of the time range to read activity from. Leave blank for 24 hours before the end of the range.
- To (`date_to`, date and time): The end of the time range to read activity from. Leave blank for now.
- Events (`event`, list): Only list these kinds of event. Deferred and suppressed need MailerSend's Starter plan or higher. One or more of: `queued`, `sent`, `delivered`, `soft_bounced` (Soft bounced), `hard_bounced` (Hard bounced), `deferred`, `opened`, `opened_unique` (Opened unique), `clicked`, `clicked_unique` (Clicked unique), and 5 more.
- Page (`page`, number): Which page of results to return, starting at 1. From 1 to 1000.
- Limit (`limit`, number): How many results to return per page, from 10 to 100. MailerSend returns 25 when this is blank. From 10 to 100.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "email": {
          "created_at": "example",
          "from": "example",
          "headers": [
            {
              "name": "example",
              "value": "example"
            }
          ],
          "html": "example",
          "id": "example",
          "recipient": {
            "created_at": "example",
            "deleted_at": "example",
            "email": "example",
            "id": "example",
            "updated_at": "example"
          },
          "status": "example",
          "subject": "example",
          "tags": [
            "example"
          ],
          "template_id": "example",
          "text": "example",
          "updated_at": "example"
        },
        "id": "example",
        "suppression_reason": "example",
        "type": "queued",
        "updated_at": "example"
      }
    ],
    "links": {
      "next": "example"
    },
    "meta": {
      "current_page": 1,
      "per_page": 1
    }
  }
}
```

### List emails

List the emails a domain sent in a time range, one per recipient, newest first, with their status. MailerSend allows 10 of these and List email activity requests a minute between them.

**Inputs**

- Domain (`domain_id`, text, required): The domain the emails were sent from.
- From (`date_from`, date and time): The start of the time range to read emails from. Leave blank for 24 hours before the end of the range.
- To (`date_to`, date and time): The end of the time range to read emails from. Leave blank for now.
- Status (`status`, list): Only list emails with one of these statuses. One or more of: `queued`, `sent`, `rejected`, `delivered`.
- Interaction (`interaction`, list): Only list emails whose recipient did one of these. One or more of: `opened`, `clicked`, `unsubscribed`, `complained`, `no_interaction` (No interaction).
- Recipient email (`recipient_email`, text): Only list emails sent to this address.
- Message ID (`message_id`, text): Only list emails created by this message, as Send an email returned it.
- Subject (`subject`, text): Only list emails whose subject contains this text (3 characters or more).
- Tag (`tag`, text): Only list emails sent with this tag.
- Page (`page`, number): Which page of results to return, starting at 1. From 1 to 100.
- Limit (`limit`, number): How many results to return per page, from 10 to 1000. MailerSend returns 25 when this is blank. From 10 to 1000.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "domain_id": "example",
        "from": "example",
        "headers": [
          {
            "name": "example",
            "value": "example"
          }
        ],
        "html": "example",
        "id": "example",
        "interaction": [
          "example"
        ],
        "message_id": "example",
        "status": "queued",
        "subject": "example",
        "suppression_reason": "example",
        "tags": [
          "example"
        ],
        "template_id": "example",
        "text": "example",
        "to": "example",
        "updated_at": "example"
      }
    ],
    "links": {
      "next": "example"
    },
    "meta": {
      "current_page": 1,
      "per_page": 1
    }
  }
}
```

### List messages

List the messages sent through MailerSend, newest first, optionally for one domain.

**Inputs**

- Domain (`domain_id`, text): Only list messages sent from this domain.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): How many results to return per page, from 10 to 100. MailerSend returns 25 when this is blank. From 10 to 100.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "id": "example",
        "updated_at": "example"
      }
    ],
    "links": {
      "next": "example"
    },
    "meta": {
      "current_page": 1,
      "per_page": 1
    }
  }
}
```

### List recipients

List the addresses your MailerSend account has sent email to.

**Inputs**

- Domain (`domain_id`, text): Only list recipients of this domain's emails.
- Page (`page`, number): Which page of results to return, starting at 1. From 1 to 1000.
- Limit (`limit`, number): How many results to return per page, from 10 to 100. MailerSend returns 25 when this is blank. From 10 to 100.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "deleted_at": "example",
        "email": "example",
        "id": "example",
        "updated_at": "example"
      }
    ],
    "links": {
      "next": "example"
    },
    "meta": {
      "current_page": 1,
      "per_page": 1
    }
  }
}
```

### List templates

List the email templates in your MailerSend account.

**Inputs**

- Domain (`domain_id`, text): Only list templates of this domain.
- Page (`page`, number): Which page of results to return, starting at 1. At least 1.
- Limit (`limit`, number): How many results to return per page, from 10 to 100. MailerSend returns 25 when this is blank. From 10 to 100.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "created_at": "example",
        "description": "example",
        "id": "example",
        "image_path": "example",
        "name": "example",
        "type": "example",
        "updated_at": "example"
      }
    ],
    "links": {
      "next": "example"
    },
    "meta": {
      "current_page": 1,
      "per_page": 1
    }
  }
}
```

### Remove from the blocklist

Remove entries from a MailerSend blocklist, so MailerSend sends to those addresses again.

**Inputs**

- Entries (`ids`, list, required): The blocklist entries to remove, from List blocklist entries or Add to the blocklist.
- Domain (`domain_id`, text): The domain whose blocklist the entries are on. Leave blank for the account's own blocklist.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

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

### Send an email

Send an email through MailerSend. The From address must be on a domain verified in your MailerSend account. Until MailerSend approves your account, each email can go to one recipient only.

**Inputs**

- From email (`from_email`, text): The address the email comes from. It must be on a domain verified in MailerSend. Leave blank only when the template sets a default sender.
- From name (`from_name`, text): The sender name recipients see.
- To (`to`, list, required): The addresses to send to, up to 50 (one until MailerSend approves your account).
- Subject (`subject`, text): The subject line. Leave blank only when the template sets a default subject.
- Plain-text body (`text`, text): The plain-text body. Give a plain-text body, an HTML body or a template.
- HTML body (`html`, text): The HTML body. Give a plain-text body, an HTML body or a template.
- Template (`template_id`, text): A MailerSend template to send instead of a body.
- Template variables (`variables`, object): Values for the {{name}} placeholders in the subject, body or template, as names and values. Every recipient in To gets the same values.
- Reply-to email (`reply_to_email`, text): The address replies go to.
- Reply-to name (`reply_to_name`, text): The name shown for the reply-to address.
- CC (`cc`, list): Addresses to copy, up to 10 (one until MailerSend approves your account).
- BCC (`bcc`, list): Addresses to blind copy, up to 10 (one until MailerSend approves your account).
- Tags (`tags`, list): Up to 5 tags to find this email by later in MailerSend.
- Send at (`send_at`, date and time): When to send the email, up to 72 hours from now. Leave blank to send now. Not available on MailerSend's free plan.

**Outputs**

- `data` (object): The response from MailerSend.

**Example output**

```json
{
  "data": {
    "message_id": "example",
    "send_paused": true,
    "warnings": [
      {
        "message": "example",
        "recipients": [
          {
            "email": "example",
            "reasons": [
              "example"
            ]
          }
        ],
        "type": "SOME_SUPPRESSED"
      }
    ]
  }
}
```
