Skip to main content

MailerLite Integration

Add a subscriber to a MailerLite group when a form is submitted.

Action type: mailerlite Class: Core_Forms\Actions\MailerLite Source: src/actions/class-mailerlite.php

Setup

  1. In MailerLite, go to Integrations > Developer API.
  2. Copy your API Key.
  3. To add subscribers to a specific group, note the Group ID (found in Groups settings).
  4. In WordPress, edit your form > Actions tab > Add Action > Add to MailerLite.
  5. Enter the API Key and optionally the Group ID.

Settings Reference

Setting Required Default Description
API Key Yes -- MailerLite API key
Group ID No -- Group ID to add the subscriber to (leave empty for no group)
Email Field No email Form field name containing the email address
Name Field No name Form field name containing the subscriber's name

Group Assignment

If a Group ID is provided, the subscriber is added to that group via the groups array in the API payload. If left empty, the subscriber is created without any group assignment.

To find your Group ID: go to Subscribers > Groups, click on a group, and find the ID in the URL or group settings.

Subscriber Fields

The integration sends: - email -- from the configured email field - fields.name -- from the configured name field

MailerLite stores the name as a subscriber field, not split into first/last.

How It Works

  1. Validates the API key and email address.
  2. Builds a subscriber payload with email and name field.
  3. If a Group ID is provided, includes it in the groups array.
  4. POSTs to https://connect.mailerlite.com/api/subscribers with Bearer auth.
  5. The request times out after 15 seconds.
  6. Returns true on success.

Example

Form with name and email fields, adding to a newsletter group:

  • API Key: your_mailerlite_api_key
  • Group ID: 12345678901234567
  • Email Field: email
  • Name Field: name

Troubleshooting

  • "Unauthorized": Ensure you are using a MailerLite Classic or MailerLite New API key. The integration uses the new MailerLite API (connect.mailerlite.com).
  • Group not found: Group IDs in the new API are long numeric strings. Double-check the ID.
  • Subscriber not appearing: The email may already exist. MailerLite does not duplicate subscribers but may update the existing record.
  • API version: This integration uses the MailerLite new API (v2). If you are on MailerLite Classic, ensure you have migrated or are using the correct API key.