> ## Documentation Index
> Fetch the complete documentation index at: https://chatbotx.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# MailerLite Integration

> Connect MailerLite with ChatbotX to create or update subscribers, select a Group and status, and sync Custom Fields from a Flow.

The **MailerLite** integration creates or updates subscribers from ChatbotX directly within a Flow. You can add customers to a Group, select their subscription status, and synchronize data with MailerLite Custom Fields.

For example, after a customer provides an email address to receive an offer, ChatbotX adds the subscriber to an appropriate Group and sends their name, phone number, company, or city to MailerLite.

## Prepare your API Token

You need to generate an **API Token** in MailerLite before connecting. This token allows ChatbotX to access subscribers, Groups, and Custom Fields in your account.

<Steps>
  <Step title="Sign in to MailerLite">
    Sign in to the MailerLite account that you want to connect to ChatbotX.
  </Step>

  <Step title="Open Integrations">
    Select **Integrations** from the left menu, then open **API**.
  </Step>

  <Step title="Generate an API Token">
    On the **Developer API** page, click **Generate new token**. Enter a name that helps you identify the token and confirm its creation.
  </Step>

  <Step title="Copy the API Token">
    Copy the token and store it securely for use in ChatbotX.

    See [MailerLite API Getting Started](https://developers.mailerlite.com/getting-started) in the official MailerLite documentation.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/09pBGR5XzsfJCSLZ/images/mailerlite_developer_api_token_settings.png?fit=max&auto=format&n=09pBGR5XzsfJCSLZ&q=85&s=8b4cbc0a829d6bc1110c5e41b03e77a2" alt="MailerLite Developer API Token Settings" width="2961" height="1879" data-path="images/mailerlite_developer_api_token_settings.png" />
    </Frame>
  </Step>
</Steps>

<Warning>
  The API Token allows other applications to access your MailerLite data. Do not share it in emails, messages, public screenshots, or customer-facing documents.
</Warning>

## Connect MailerLite to ChatbotX

<Steps>
  <Step title="Open Settings">
    In your ChatbotX workspace, select **Settings** from the left menu.
  </Step>

  <Step title="Select Integrations">
    Select the **Integrations** tab, then open **MailerLite**.
  </Step>

  <Step title="Open the connection window">
    Click **Connect** to open the **Connect MailerLite** window.
  </Step>

  <Step title="Enter the API Token">
    Paste the generated token into **API Token**, then click **Confirm**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/09pBGR5XzsfJCSLZ/images/connect_mailerlite_in_chatbotx_integrations.png?fit=max&auto=format&n=09pBGR5XzsfJCSLZ&q=85&s=600321858ec655aafab6ec5a18e4850f" alt="Connect MailerLite in ChatbotX Integrations" width="3180" height="1572" data-path="images/connect_mailerlite_in_chatbotx_integrations.png" />
    </Frame>
  </Step>
</Steps>

When the token is valid, ChatbotX saves the connection and loads the Groups and Custom Fields from your MailerLite account for use in Flows.

## Add MailerLite to a Flow

Place the MailerLite action after collecting the email address and any other data that you want to synchronize. The action uses the email address to create a new subscriber or update an existing one.

<Steps>
  <Step title="Open the Flow">
    Select **Flows**, then open the Flow that you want to use for collecting subscribers.
  </Step>

  <Step title="Add Actions">
    In a Send Message node, click **+ Create**, then select **Actions**.
  </Step>

  <Step title="Select Email Actions">
    Open **Email Actions** and select **Add Contact to MailerLite**.

    <Frame>
      <img src="https://mintcdn.com/chatbotx/09pBGR5XzsfJCSLZ/images/select_add_contact_to_mailerlite_action.png?fit=max&auto=format&n=09pBGR5XzsfJCSLZ&q=85&s=e4bc6f3e9e0ecfdf39509fa5d9cb2ebc" alt="Select Add Contact to MailerLite Action" width="3182" height="1887" data-path="images/select_add_contact_to_mailerlite_action.png" />
    </Frame>
  </Step>

  <Step title="Open the configuration">
    Click **Edit** on the new action to select a Group, subscription status, and subscriber data mappings.
  </Step>
</Steps>

## Configure Add Contact to MailerLite

Configure the fields in the **Add Contact to MailerLite** window, then click **Save**.

| Field                           | Configuration                                                                                                                               |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| **Group**                       | Select the MailerLite Group that will receive the subscriber. This field is optional.                                                       |
| **Email Field**                 | Select the ChatbotX field that stores the customer's email address. MailerLite uses the email address to create or identify the subscriber. |
| **Type**                        | Select the appropriate subscription status. Choose **Subscribed** only when the customer has agreed to receive email marketing.             |
| **Custom Fields in MailerLite** | Select a ChatbotX field on the left and map it to the corresponding MailerLite field on the right. This field is optional.                  |
| **Add New**                     | Click to add another Custom Field mapping row.                                                                                              |

<Frame>
  <img src="https://mintcdn.com/chatbotx/09pBGR5XzsfJCSLZ/images/configure_add_contact_to_mailerlite.png?fit=max&auto=format&n=09pBGR5XzsfJCSLZ&q=85&s=b2e85905d114f07024868d1e54981ff6" alt="Configure Add Contact to MailerLite" width="3184" height="1886" data-path="images/configure_add_contact_to_mailerlite.png" />
</Frame>

<Note>
  Groups and Custom Fields must already exist in MailerLite before you configure the action. Leaving Group empty does not remove the subscriber from Groups they have already joined.
</Note>

## Map Custom Fields

Mapping allows MailerLite to receive additional data for email personalization or subscriber segmentation.

| MailerLite field | Suitable ChatbotX data                       |
| ---------------- | -------------------------------------------- |
| **Name**         | The field that stores the customer's name.   |
| **Phone**        | The field that stores the phone number.      |
| **Company**      | A Custom Field that stores the company name. |
| **City**         | A Custom Field that stores the city.         |

Select the correct data type for each field. The email address must be valid, and each Custom Field value must match the field type configured in MailerLite.

## Example: collect subscribers for an offer

A fashion store wants to collect email addresses from interested customers and introduce a new collection.

<Steps>
  <Step title="Collect customer information">
    Use Get User Data to request the customer's email address, name, and phone number, then save the responses to their corresponding fields.
  </Step>

  <Step title="Add the subscriber to MailerLite">
    Run **Add Contact to MailerLite**, select the **Email** field, and choose an appropriate Group when customer classification is needed.
  </Step>

  <Step title="Synchronize additional data">
    Select the appropriate status, then map the customer's name and phone number to MailerLite Custom Fields.
  </Step>
</Steps>

## Test the integration

Before publishing the Flow, test it with an email address that you can verify.

* Open **Subscribers** in MailerLite and confirm that the subscriber appears.
* Check that MailerLite received the correct Group, status, and Custom Fields.
* If a Group or Custom Field does not appear, check the connection and reopen the action.
* If the API Token is no longer valid, generate a new token and reconnect it in ChatbotX.

<Warning>
  MailerLite restricts reactivating subscribers marked as Unsubscribed, Bounced, or Junk to prevent abuse. Do not use this action to change a status when the customer has not agreed to receive messages.
</Warning>
