PHPackages                             goldopuk/my-mailerlite-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Mail &amp; Notifications](/categories/mail)
4. /
5. goldopuk/my-mailerlite-php

ActiveLibrary[Mail &amp; Notifications](/categories/mail)

goldopuk/my-mailerlite-php
==========================

MailerLite PHP SDK for Laravel 10

v1.0.0(2y ago)04MITPHPPHP ^7.4|^8.0

Since Nov 30Pushed 2y agoCompare

[ Source](https://github.com/goldopuk/mailerlite-php)[ Packagist](https://packagist.org/packages/goldopuk/my-mailerlite-php)[ Docs](https://github.com/goldopuk/mailerlite-php)[ RSS](/packages/goldopuk-my-mailerlite-php/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (14)Versions (3)Used By (0)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0820f8a0225840325706de9d31a9b7c93165cc48f1f948115dffb2944c694153/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61696c65726c6974652f6d61696c65726c6974652d7068702e737667)](https://packagist.org/packages/mailerlite/mailerlite-php)[![Tests](https://github.com/mailerlite/mailerlite-php/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/mailerlite/mailerlite-php/actions/workflows/test.yml)[![PHPStan](https://github.com/mailerlite/mailerlite-php/actions/workflows/static.yml/badge.svg)](https://github.com/mailerlite/mailerlite-php/actions/workflows/static.yml)[![Total Downloads](https://camo.githubusercontent.com/48be1e2b63ad1d6d70fd51e382f855f59796d8240e70f316e6fd65d900e69adc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61696c65726c6974652f6d61696c65726c6974652d7068702e737667)](https://packagist.org/packages/mailerlite/mailerlite-php)

Table of Contents
=================

[](#table-of-contents)

- [Installation](#installation)
- [Usage](#usage)
    - [Subscriber API](#subscriber-api)
        - [Create](#create-subscriber)
        - [Read](#read-subscriber)
        - [Update](#update-subscriber)
        - [Delete](#delete-subscriber)
    - [Campaign API](#email-api)
        - [Create](#create-campaign)
        - [Read](#read-campaign)
        - [Update](#update-campaign)
        - [Delete](#delete-campaign)
        - [Schedule](#schedule-campaign)
        - [Cancel](#cancel-campaign)
        - [Subscriber activity](#campaign-subscriber-activity)
    - [Group API](#group)
        - [Create](#group-create)
        - [Update](#group-update)
        - [Read](#group-read)
        - [Delete](#group-delete)
        - [Get subscribers](#group-list-subscribers)
        - [Assign subscriber](#group-assign-subscriber)
        - [Unassign subscriber](#group-unassign-subscriber)
    - [Segment API](#segment)
        - [Update](#segment-update)
        - [Read](#segment-read)
        - [Delete](#segment-delete)
        - [Get subscribers](#segment-list-subscribers)
    - [Field API](#field)
        - [Create](#field-create)
        - [Update](#field-update)
        - [Read](#field-read)
        - [Delete](#field-delete)
    - [Form API](#form)
        - [Update](#form-update)
        - [Read](#form-read)
        - [Delete](#form-delete)
        - [Signups](#form-subscribers)
    - [Automation API](#automation)
        - [Read](#automation-read)
        - [Activity](#automation-activity)
    - [Webhook API](#webhook)
        - [Create](#webhook-create)
        - [Update](#webhook-update)
        - [Read](#webhook-read)
        - [Delete](#webhook-delete)
    - [Campaign language API](#campaign-language-read)
    - [Timezone API](#timezone-read)
    - [Batch API](#batch-send)
- [Testing](#testing)
- [License](#license)

Installation
============

[](#installation)

Requirements
------------

[](#requirements)

- PHP 7.4
- An API Key from MailerLite
- PSR-7 and PSR-18 based HTTP adapter

Setup
-----

[](#setup)

```
composer require mailerlite/mailerlite-php
```

If you get an error saying “Could not find resource using any discovery strategy.” it means that all the discovery strategies have failed. Most likely, your project is missing the message factories and/or a PRS-7 implementation. To resolve this you may run

```
$ composer require php-http/curl-client guzzlehttp/psr7 php-http/message
```

Usage
=====

[](#usage)

Subscriber
----------

[](#subscriber)

More information on request parameters:

### Create

[](#create)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$data = [
    'email' => 'subscriber@example.com',
];

$response = $mailerLite->subscribers->create($data);
```

### Read

[](#read)

Single record

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$subscriberId = '123';

$response = $mailerLite->subscribers->find($subscriberId);
```

All records

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$response = $mailerLite->subscribers->get();
```

### Update

[](#update)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$subscriberId = '123',

$data = [
    'fields' => [
        'name' => 'Example',
    ],
];

$response = $mailerLite->subscribers->update($subscriberId, $data);
```

### Delete

[](#delete)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$subscriberId = '123';

$response = $mailerLite->subscribers->delete($subscriberId);
```

Campaign
--------

[](#campaign)

More information on request parameters:

### Create

[](#create-1)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$data = [
    'type' => 'regular',
    'name' => 'My new campaign',
    'language_id' => 10,
    'emails' => [
        [
            'subject' => 'My new email',
            'from_name' => 'me',
            'from' => 'me@example.com',
            'content' => 'Hello World!',
        ]
    ],
    'filter' => [],
];

$response = $mailerLite->campaigns->create($data);
```

### Read

[](#read-1)

Single record

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$campaignId = '123';

$response = $mailerLite->campaigns->find($campaignId);
```

All records

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$data = [
    'filter' => ['status' => 'sent'],
];

$response = $mailerLite->campaigns->get($data);
```

### Update

[](#update-1)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$campaignId = '123';

$data = [
    'name' => 'Changed campaign name',
    'emails' => [
        [
            'subject' => 'Changed email subject',
            'from_name' => 'Changed from name',
            'from' => 'changed@example.com',
        ]
    ],
];

$response = $mailerLite->campaigns->update($campaignId, $data);
```

### Delete

[](#delete-1)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$campaignId = '123';

$response = $mailerLite->campaigns->delete($campaignId);
```

### Schedule

[](#schedule)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$campaignId = '123';

$data = [
    'delivery' => 'instant',
];

$response = $mailerLite->campaigns->schedule($campaignId, $data);
```

### Cancel

[](#cancel)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$campaignId = '123';

$response = $mailerLite->campaigns->cancel($campaignId);
```

### Subscriber activity of sent campaign

[](#subscriber-activity-of-sent-campaign)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$campaignId = '123';
$data = [
    'type' => 'opened',
];

$response = $mailerLite->campaigns->getSubscriberActivity($campaignId, $data);
```

Group API
---------

[](#group-api)

More information on request parameters:

### Create

[](#create-2)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$data = [
    "name" => "New group",
];

$response = $mailerLite->groups->create($data);
```

### Read

[](#read-2)

Single record

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$groupId = '123';

$response = $mailerLite->groups->find($groupId);
```

All records

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$response = $mailerLite->groups->get();
```

### Update

[](#update-2)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$groupId = '123';
$data = [
    "name" => "Updated name",
];

$response = $mailerLite->groups->update($groupId, $data);
```

### Delete

[](#delete-2)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$groupId = '123';

$response = $mailerLite->groups->delete($groupId);
```

### Get subscribers who belong to a group

[](#get-subscribers-who-belong-to-a-group)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$groupId = '123';

$response = $mailerLite->groups->getSubscribers($groupId);
```

### Assign subscriber to a group

[](#assign-subscriber-to-a-group)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$groupId = '123';
$subscriberId = '456';

$response = $mailerLite->groups->assignSubscriber($groupId, $subscriberId);
```

### unassign subscriber from a group

[](#unassign-subscriber-from-a-group)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$groupId = '123';
$subscriberId = '456';

$response = $mailerLite->groups->unAssignSubscriber($groupId, $subscriberId);
```

Segment API
-----------

[](#segment-api)

More information on request parameters:

### Read

[](#read-3)

All records

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$response = $mailerLite->segments->get();
```

### Update

[](#update-3)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$segmentId = '123';
$data = [
    "name" => "Updated name",
];

$response = $mailerLite->segments->update($segmentId, $data);
```

### Delete

[](#delete-3)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$segmentId = '123';

$response = $mailerLite->segments->delete($segmentId);
```

### Get subscribers who belong to a segment

[](#get-subscribers-who-belong-to-a-segment)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$segmentId = '123';

$response = $mailerLite->segments->getSubscribers($segmentId);
```

Field API
---------

[](#field-api)

More information on request parameters:

### Create

[](#create-3)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$data = [
    "name" => "New field",
    "type" => "text",
];

$response = $mailerLite->fields->create($data);
```

### Read

[](#read-4)

All records

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$response = $mailerLite->fields->get();
```

### Update

[](#update-4)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$fieldId = '123';
$data = [
    "name" => "Updated name",
];

$response = $mailerLite->fields->update($fieldId, $data);
```

### Delete

[](#delete-4)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$fieldId = '123';

$response = $mailerLite->fields->delete($fieldId);
```

Form API
--------

[](#form-api)

More information on request parameters:

### Read

[](#read-5)

All records

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$response = $mailerLite->forms->get('popup', []);
```

Single

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$formId = '123';

$response = $mailerLite->forms->find($formId);
```

### Update

[](#update-5)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$formId = '123';
$data = [
    "name" => "Updated name",
];

$response = $mailerLite->forms->update($formId, $data);
```

### Delete

[](#delete-5)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$formId = '123';

$response = $mailerLite->forms->delete($formId);
```

### Signed up subscribers

[](#signed-up-subscribers)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$formId = '123';

$response = $mailerLite->forms->getSignups($formId);
```

Automation API
--------------

[](#automation-api)

More information on request parameters:

### Read

[](#read-6)

All records

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$response = $mailerLite->automations->get([]);
```

Single

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$automationId = '123';

$response = $mailerLite->automations->find($automationId);
```

### Activity

[](#activity)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$automationId = '123';
$data = [
    'filter' => [
        'status' => 'active',
    ],
];

$response = $mailerLite->automations->activity($automationId, $data);
```

Webhook API
-----------

[](#webhook-api)

More information on request parameters:

### Create

[](#create-4)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$data = [
    "name" => "Name",
    "events" => ["subscriber.created"],
    "url": "https://www.cartwright.info/eligendi-soluta-corporis-in-quod-ullam",
];

$response = $mailerLite->webhooks->create($data);
```

### Read

[](#read-7)

All records

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$response = $mailerLite->webhooks->get([]);
```

Single

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$webhookId = '123';

$response = $mailerLite->webhooks->find($webhookId);
```

### Update

[](#update-6)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$webhookId = '123';
$data = [
    "name" => "Updated name",
];

$response = $mailerLite->webhooks->update($webhookId, $data);
```

### Delete

[](#delete-6)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$webhookId = '123';

$response = $mailerLite->webhooks->delete($webhookId);
```

Campaign language API
---------------------

[](#campaign-language-api)

More information about request parameters on

### Read

[](#read-8)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$response = $mailerLite->campaignLanguages->get();
```

Timezone API
------------

[](#timezone-api)

More information about request parameters on

### Read

[](#read-9)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$response = $mailerLite->timezones->get();
```

Batch API
---------

[](#batch-api)

More information about request parameters on

### Send

[](#send)

```
use MailerLite\MailerLite;

$mailerLite = new MailerLite(['api_key' => 'key']);

$data = [
    'requests' => [
        [
            'method' => 'post',
            'path' => 'api/subscribers',
            'body' => [
                'email' => 'new_subscriber@mail.com'
            ]
        ]
    ]
];
$response = $mailerLite->batches->send($data);
```

Testing
=======

[](#testing)

```
composer test
```

Support and Feedback
====================

[](#support-and-feedback)

In case you find any bugs, submit an issue directly here in GitHub.

You are welcome to create SDK for any other programming language.

If you have any troubles using our API or SDK free to contact our support by email

License
=======

[](#license)

[The MIT License (MIT)](LICENSE.md)

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

945d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7535d5d66d2cdbd5beaca61a214cb9f74c824dacf3a4080ebe980c30777e0805?d=identicon)[goldopuk](/maintainers/goldopuk)

---

Top Contributors

[![npetrunova](https://avatars.githubusercontent.com/u/11510615?v=4)](https://github.com/npetrunova "npetrunova (17 commits)")[![rekerta](https://avatars.githubusercontent.com/u/39701684?v=4)](https://github.com/rekerta "rekerta (14 commits)")[![nklmilojevic](https://avatars.githubusercontent.com/u/9573356?v=4)](https://github.com/nklmilojevic "nklmilojevic (3 commits)")[![thenabeel](https://avatars.githubusercontent.com/u/3117493?v=4)](https://github.com/thenabeel "thenabeel (3 commits)")[![johnkelesidis](https://avatars.githubusercontent.com/u/72185528?v=4)](https://github.com/johnkelesidis "johnkelesidis (3 commits)")[![shuvroroy](https://avatars.githubusercontent.com/u/21066418?v=4)](https://github.com/shuvroroy "shuvroroy (2 commits)")[![goldopuk](https://avatars.githubusercontent.com/u/1417213?v=4)](https://github.com/goldopuk "goldopuk (2 commits)")[![mlasek1991](https://avatars.githubusercontent.com/u/135223609?v=4)](https://github.com/mlasek1991 "mlasek1991 (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/goldopuk-my-mailerlite-php/health.svg)

```
[![Health](https://phpackages.com/badges/goldopuk-my-mailerlite-php/health.svg)](https://phpackages.com/packages/goldopuk-my-mailerlite-php)
```

###  Alternatives

[telnyx/telnyx-php

Official Telnyx PHP SDK — APIs for Voice, SMS, MMS, WhatsApp, Fax, SIP Trunking, Wireless IoT, Call Control, and more. Build global communications on Telnyx's private carrier-grade network.

35789.4k2](/packages/telnyx-telnyx-php)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28150.5k](/packages/phpro-http-tools)[openai-php/client

OpenAI PHP is a supercharged PHP API client that allows you to interact with the Open AI API

5.8k28.0M315](/packages/openai-php-client)[brd6/notion-sdk-php

Notion SDK for PHP

6123.0k](/packages/brd6-notion-sdk-php)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.9M734](/packages/sylius-sylius)[mailgun/mailgun-php

The Mailgun SDK provides methods for all API functions.

1.1k30.8M181](/packages/mailgun-mailgun-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
