# Mailgun

> Send and track emails with Mailgun.

App · Email · 2 actions. Web page: https://docs.lodol.com/docs/integrations/mailgun

## Actions

### Get domain stats

Get summary statistics for email events, such as delivered or opened, on your Mailgun domain. Requires a full-access account API key; a domain-restricted Sending key cannot read stats.

**Inputs**

- Event (`event`, text, required): The email event to report on. One of: `accepted`, `delivered`, `failed`, `opened`, `clicked`, `unsubscribed`, `complained`, `stored`.
- Start date (`start_date`, text, required): Start date (YYYY-MM-DD).
- End date (`end_date`, text, required): End date (YYYY-MM-DD).
- Group results by (`resolution`, text): Optional grouping for the results. One of: `hour`, `day`, `month`.

**Outputs**

- `stats` (object): Stats details.

**Example output**

```json
{
  "stats": {}
}
```

### Send an email

Send a plain text or HTML email through a Mailgun sending domain.

**Inputs**

- From email (`from_email`, text, required): Sender email address (must belong to the Mailgun domain).
- To (`to`, text, required): Recipient email address or comma-separated list.
- Subject (`subject`, text, required): Subject line for the email.
- Body (plain text) (`text`, text, required): Plain text body.
- Body (HTML) (`html`, text): Optional HTML version of the email body.
- CC (`cc`, text): Optional CC recipients (comma-separated).
- BCC (`bcc`, text): Optional BCC recipients (comma-separated).

**Outputs**

- `result` (object): Result details.

**Example output**

```json
{
  "result": {}
}
```
