PHPackages                             sreedev/laravel-mailchimp - 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. sreedev/laravel-mailchimp

ActiveLibrary

sreedev/laravel-mailchimp
=========================

Laravel MailChimp Package

1.0.0(5y ago)01.2k[3 PRs](https://github.com/rsreedevan/laravel-mailchimp/pulls)MITPHP

Since Jun 9Pushed 3y ago1 watchersCompare

[ Source](https://github.com/rsreedevan/laravel-mailchimp)[ Packagist](https://packagist.org/packages/sreedev/laravel-mailchimp)[ RSS](/packages/sreedev-laravel-mailchimp/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (5)Used By (0)

laravel-mailchimp - MailChimp API V3
====================================

[](#laravel-mailchimp---mailchimp-api-v3)

Super-simple, minimum abstraction MailChimp API v3 library for Laravel

Please refer MailChimp API docs to get to know more about the methods available

Requires PHP 7.2+

[![Build Status](https://camo.githubusercontent.com/daffea4ba32a323148031d5cfe8d75a4164e304cc902355a73964f3729756b9c/68747470733a2f2f7472617669732d63692e6f72672f7273726565646576616e2f6c61726176656c2d6d61696c6368696d702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/drewm/mailchimp-api)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e796b492ece123ed517af511a1d6d0dba5c8b060f5a39534f3c66c2541d44a18/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7273726565646576616e2f6c61726176656c2d6d61696c6368696d702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/drewm/mailchimp-api/?branch=master)[![Code Intelligence Status](https://camo.githubusercontent.com/93e9055e09bd492757c48730946bdc580d4e7a890aaa2ae83c4ff039352cf198/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7273726565646576616e2f6c61726176656c2d6d61696c6368696d702f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d6d6173746572)](https://scrutinizer-ci.com/code-intelligence)Installation
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

[](#installation)

You can install laravel-mailchimp using Composer:

```
composer require sreedev/laravel-mailchimp
```

You will then need to:

- run `composer install` to get these dependencies added to your vendor directory
- publish the config to your application with this line: `php artisan vendor:publish --provider="Sreedev\MailChimp\MailChimpServiceProvider" --tag="config"`
- set the `MAIL_CHIMP_API_KEY="" ` in the .env file

Examples
--------

[](#examples)

Start by `use`-ing the library by adding use

```
 use Sreedev\MailChimp\Facades\MailChimp;
```

Then, list all the mailing lists (with a `get` on the `lists` method)

```
$result = MailChimp::get('lists');

print_r($result);
```

Subscribe someone to a list (with a `post` to the `lists/{listID}/members` method):

```
$list_id = 'b1234346';

$result = MailChimp::post("lists/$list_id/members", [
				'email_address' => 'member@example.com',
				'status'        => 'subscribed',
			]);

print_r($result);
```

Update a list member with more information (using `patch` to update):

```
$list_id = 'b1234346';
$subscriber_hash = MailChimp::subscriberHash('subscriber@example.com');

$result = MailChimp::patch("lists/$list_id/members/$subscriber_hash", [
				'merge_fields' => ['FNAME'=>'First', 'LNAME'=>'Man'],
				'interests'    => ['2s3a384h' => true],
			]);

print_r($result);
```

Remove a list member using the `delete` method:

```
$list_id = 'b1234346';
$subscriber_hash = MailChimp::subscriberHash('subscriber@example.com');

MailChimp::delete("lists/$list_id/members/$subscriber_hash");
```

Quickly test for a successful action with the `success()` method:

```
$list_id = 'b1234346';

$result = MailChimp::post("lists/$list_id/members", [
				'email_address' => 'subscriber@example.com',
				'status'        => 'subscribed',
			]);

if (MailChimp::success()) {
	print_r($result);
} else {
	echo MailChimp::getLastError();
}
```

Batch Operations
----------------

[](#batch-operations)

The MailChimp [Batch Operations](http://developer.mailchimp.com/documentation/mailchimp/guides/how-to-use-batch-operations/) this enables you to complete multiple operations with a single call. Eg: Adding thousands of members to a list - you can perform this in one request rather than thousands.

```
use Sreedev\MailChimp\Facades\MailChimp;

$Batch 	   = MailChimp::newBatch()
```

You need to set an ID for the operation as the first argument, and also that you won't get a response. The ID is used for finding the result of this request in the combined response from the batch operation.

```
$list_id ="abcd";
$Batch->post("op1", "lists/$list_id/members", [
				'email_address' => 'subscriber1@example.com',
				'status'        => 'subscribed',
			]);

$Batch->post("op2", "lists/$list_id/members", [
				'email_address' => 'subscriber2@example.com',
				'status'        => 'subscribed',
			]);

$Batch->post("op3", "lists/$list_id/members", [
				'email_address' => 'subscriber3@example.com',
				'status'        => 'subscribed',
			]);
```

Once you've finished all the requests that should be in the batch, you need to process it.

```
$result = $Batch->process();
```

The result includes a batch ID. At a later point, you can check the status of your batch:

```
MailChimp::newBatch($batchId);
$result = $Batch->checkStatus();
```

When your batch is finished, you can download the results (in JSON format) from the URL given in the response.

Troubleshooting
---------------

[](#troubleshooting)

To get the last error returned by either the HTTP client or by the API, use `getLastError()`:

```
echo MailChimp::getLastError();
```

For further debugging, you can inspect the headers and body of the response:

```
print_r(MailChimp::getLastResponse());
```

If you suspect you're sending data in the wrong format, you can look at what was sent to MailChimp by the wrapper:

```
print_r(MailChimp::getLastRequest());
```

If your server's CA root certificates are not up to date you may find that SSL verification fails and you don't get a response. The correction solution for this [is not to disable SSL verification](http://snippets.webaware.com.au/howto/stop-turning-off-curlopt_ssl_verifypeer-and-fix-your-php-config/). The solution is to update your certificates.

Contributing
------------

[](#contributing)

This is a simple wrapper, but contributions can make it beeter. If you'd like to suggest an improvement, please raise an issue to discuss it before making your pull request.

Pull requests for bugs are more than welcome - please explain the bug you're trying to fix in the message.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 94.4% of commits — single point of failure

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

2163d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b3f614b930a5e027128c357c0e8e938519f42cd33a1fefb3a8dea43da0f4bc9?d=identicon)[sreedev](/maintainers/sreedev)

---

Top Contributors

[![sreedev-r](https://avatars.githubusercontent.com/u/32166094?v=4)](https://github.com/sreedev-r "sreedev-r (17 commits)")[![rsreedevan](https://avatars.githubusercontent.com/u/2265979?v=4)](https://github.com/rsreedevan "rsreedevan (1 commits)")

### Embed Badge

![Health badge](/badges/sreedev-laravel-mailchimp/health.svg)

```
[![Health](https://phpackages.com/badges/sreedev-laravel-mailchimp/health.svg)](https://phpackages.com/packages/sreedev-laravel-mailchimp)
```

PHPackages © 2026

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