# Mailchimp

> Manage your Mailchimp audiences, members, and email campaigns.

App · Email Marketing · 9 actions. Web page: https://docs.lodol.com/docs/integrations/mailchimp

## Actions

### Add member to audience

Add or subscribe a contact to a Mailchimp audience.

**Inputs**

- Audience ID (`list_id`, text, required): The ID of the Mailchimp audience.
- Email (`email`, text, required): Subscriber email
- Subscription status (`status`, text): Whether the contact is subscribed now, or pending until they confirm via email. One of: `subscribed`, `pending` (Pending (send a confirmation email first)), `unsubscribed`, `cleaned` (Cleaned (invalid or bounced)). Default: `subscribed`.
- First name (`first_name`, text): First name
- Last name (`last_name`, text): Last name

**Outputs**

- `email_address` (text): Member's email address
- `id` (text): Member ID (MD5 hash of lowercase email address)
- `status` (text): Subscription status
- `unique_email_id` (text): Unique identifier for this email address

**Example output**

```json
{
  "email_address": "user@example.com",
  "id": "abc123xyz789",
  "status": "subscribed",
  "unique_email_id": "abc123xyz789"
}
```

### Create a Mailchimp audience

Create a new Mailchimp audience with contact and sender defaults.

**Inputs**

- Name (`name`, text, required): Audience name
- Permission reminder (`permission_reminder`, text, required): A short note reminding subscribers why they're receiving your emails.
- From name (`from_name`, text, required): Default from name
- From email (`from_email`, text, required): Default from email
- Company (`company`, text, required): Company name
- Street address (`address1`, text, required): Street address
- City (`city`, text, required): City
- State / region (`state`, text, required): State or region. Mailchimp requires this for the audience contact address.
- ZIP / postal code (`zip`, text, required): ZIP or postal code. Mailchimp requires this for the audience contact address.
- Country (`country`, text, required): Country
- Email type option (`email_type_option`, true/false): Set to true to let subscribers choose between HTML and plain-text emails. Default: `true`.

**Outputs**

- `id` (text): Mailchimp audience/list ID
- `name` (text): Audience name as displayed in Mailchimp
- `web_id` (number): Web-accessible ID for the audience

**Example output**

```json
{
  "id": "abc123xyz789",
  "name": "Newsletter Subscribers",
  "web_id": 1
}
```

### Create a Mailchimp campaign

Create a new campaign for a given audience.

**Inputs**

- Audience ID (`list_id`, text, required): The ID of the Mailchimp audience.
- Subject (`subject`, text, required): Campaign subject
- From name (`from_name`, text, required): Sender name
- Reply to (`reply_to`, text, required): Reply-to email
- Campaign type (`type`, text): The kind of email campaign to create. One of: `regular` (Regular (standard HTML email)), `plaintext` (Plain-text email). Default: `regular`.

**Outputs**

- `id` (text): Mailchimp campaign ID
- `status` (text): Current campaign status
- `type` (text): Campaign type
- `web_id` (number): Web-accessible ID for the campaign

**Example output**

```json
{
  "id": "abc123xyz789",
  "status": "save",
  "type": "regular",
  "web_id": 1
}
```

### List Mailchimp audiences

List your Mailchimp audiences.

**Inputs**

- Count (`count`, number): Maximum number of audiences to return

**Outputs**

- `results` (list): List of results

**Example output**

```json
{
  "results": [
    {
      "id": "abc123xyz789",
      "name": "Newsletter Subscribers",
      "stats": {
        "member_count": 42
      },
      "web_id": 1
    }
  ]
}
```

### Remove member from audience

Remove a subscriber from a Mailchimp audience.

**Inputs**

- Audience ID (`list_id`, text, required): The ID of the Mailchimp audience.
- Email (`email`, text, required): Subscriber email

**Outputs**

- `deleted` (true/false): Indicates whether the member was successfully deleted

**Example output**

```json
{
  "deleted": true
}
```

### Send a Mailchimp campaign

Send a campaign that is ready to be delivered.

**Inputs**

- Campaign ID (`campaign_id`, text, required): The ID of the Mailchimp campaign to send.

**Outputs**

- `complete` (true/false): Indicates whether the campaign was successfully sent

**Example output**

```json
{
  "complete": true
}
```

### Set Mailchimp campaign content

Set the HTML and/or plain-text content of a campaign so it is ready to send.

**Inputs**

- Campaign ID (`campaign_id`, text, required): The ID of the Mailchimp campaign to set content for.
- HTML content (`html`, text): Full HTML body of the email. Provide this and/or plain-text content.
- Plain-text content (`plain_text`, text): Plain-text body of the email. Provide this and/or HTML content.

**Outputs**

- `html` (text): The HTML content set on the campaign
- `plain_text` (text): The plain-text content set on the campaign

**Example output**

```json
{
  "html": "<p>This is a test campaign. Please ignore.</p>",
  "plain_text": "This is a test campaign. Please ignore."
}
```

### Tag a Mailchimp member

Create a tag and apply it to a subscriber.

**Inputs**

- Audience ID (`list_id`, text, required): The ID of the Mailchimp audience.
- Email (`email`, text, required): Subscriber email
- Tag name (`tag_name`, text, required): Tag name

**Outputs**

- `tags` (list): Array of all tags assigned to this member

**Example output**

```json
{
  "tags": [
    {
      "id": 1,
      "name": "VIP"
    }
  ]
}
```

### Update member status

Update the subscription status of a member in an audience.

**Inputs**

- Audience ID (`list_id`, text, required): The ID of the Mailchimp audience.
- Email (`email`, text, required): Subscriber email
- New status (`status`, text, required): The subscription status to set for this contact. One of: `subscribed`, `pending` (Pending (send a confirmation email first)), `unsubscribed`, `cleaned` (Cleaned (invalid or bounced)).

**Outputs**

- `email_address` (text): Member's email address with updated status
- `id` (text): Member ID (MD5 hash of lowercase email address)
- `status` (text): Updated subscription status

**Example output**

```json
{
  "email_address": "user@example.com",
  "id": "abc123xyz789",
  "status": "unsubscribed"
}
```
