Search by

concept7 / statamic-mailerlite-connector

concept7

A Statamic form connector that subscribes form submissions to MailerLite, with per-connection field mapping and groups.

Package info

github.com/concept7/statamic-mailerlite-connector

Type:statamic-addon

pkg:composer/concept7/statamic-mailerlite-connector

Fund package maintenance!

Concept7

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

0.1.0 2026-12-02 21:42 UTC

This package is auto-updated.

Last update: 2026-12-02 22:16:29 UTC


README

MailerLite Connector for Statamic: send form submissions to MailerLite

MailerLite Connector for Statamic

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A Statamic form connector that subscribes form submissions to MailerLite. Connect a form on its Connect tab, map MailerLite fields to values from the submission, and pick the groups subscribers are added to.

Requirements

  • PHP 8.4+
  • Statamic 6.44+ (form connectors)
  • Laravel 12 or 13
  • A queue worker, or the sync queue driver

Installation

composer require concept7/statamic-mailerlite-connector

Configuration

Add your MailerLite API key in the Control Panel under Tools → Addons → MailerLite Connector → Settings. Create a key in MailerLite under Integrations → MailerLite API.

The key is stored in resources/addons/statamic-mailerlite-connector.yaml. Without a key, MailerLite connections are skipped and the Connect tab asks for one.

Usage

Open a form in the Control Panel, go to Connect and add a MailerLite connection:

  • Fields: each row sends a value to one MailerLite subscriber field. Type @ in the value to insert a form field, such as @email, or combine fields and text: @first_name @last_name. A row for Email is required; every other row is optional.
  • Groups: subscribers are added to these groups. Leave empty to only create or update the subscriber.
  • Conditions: like every connection, a MailerLite connection can be sent always, or only when the submission matches conditions, for example when a consent checkbox is ticked.

A form can have several MailerLite connections, for example one per group with its own conditions.

The connection is stored on the form itself:

connections:
  mailerlite:
    - id: aB3dE5fG
      fields:
        - { id: r1, key: email, value: '[[email]]' }
        - { id: r2, key: name, value: '[[name]]' }
        - { id: r3, key: company, value: '[[organization]]' }
      groups:
        - '123456789'

How it works

A visitor submits a form, the connector maps it, and a queued job subscribes them in MailerLite

When a submission is finalized (not for spam), every matching MailerLite connection queues a job. The job resolves the mapped values, leaves out empty ones, and calls MailerLite's create or update subscriber endpoint through the MailerLite PHP SDK. Existing subscribers are updated and added to the groups. For submissions from the site, the visitor's IP address is sent along.

MailerLite response What happens
Success Done
Validation error (422) Logged with the rejected field names, not retried
Rate limited (429) Retried after the Retry-After delay
Refused key (401/403) or another client error Logged, not retried
Server error (5xx) or network error Retried up to 3 times

Submission values are never written to the log. The queued job is encrypted.

Testing

composer test
composer analyse

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

The MIT License (MIT). Please see License File for more information.