PHPackages                             slicklabs/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. [API Development](/categories/api)
4. /
5. slicklabs/mailchimp

ActiveLibrary[API Development](/categories/api)

slicklabs/mailchimp
===================

MailChimp API v3 wrapper for PHP

39231PHP

Since Apr 24Pushed 8y ago2 watchersCompare

[ Source](https://github.com/wefabric/MailChimp)[ Packagist](https://packagist.org/packages/slicklabs/mailchimp)[ RSS](/packages/slicklabs-mailchimp/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

MailChimp
=========

[](#mailchimp)

Created with the single purpose to communicate with the MailChimp API v3 as straight forward as possible with proper error handling.

- Uses [Guzzle](http://docs.guzzlephp.org/) to make HTTP requests to the MailChimp API
- Build for the future, PSR-1, PSR-2 &amp; PSR-7 compliant
- Very flexible, easily extend the MailChimp class and create your own business logic
- Able to set MailChimp API key on the fly

Usage
-----

[](#usage)

Because the simple nature of this library you can call the [MailChimp API methods](http://developer.mailchimp.com/documentation/mailchimp/reference/overview/) by the desired HTTP request method.

First of all you have to include the MailChimp class.

```
require 'vendor/autoload.php';

use SlickLabs\MailChimp\MailChimp;
use SlickLabs\MailChimp\Exception\ResponseException;

$MailChimp = new MailChimp('MAILCHIMP-API-KEY');
```

For retrieving the MailChimp lists

```
try {
    $response = $MailChimp->get("lists");
    echo ''; print_r($response->getBody()); echo '';
} catch(ResponseException $e) {
    echo $e->getStatusCode().'';
    echo $e->getTitle().'';
    echo $e->getType().'';
    echo $e->getDetail().'';
}
```

Or adding a new subscriber to a list.

```
$args = [
    "body" => [
        "email_address" => "myemail@myemail.com",
        "status" => "pending"
    ]
];

try {
    $response = $MailChimp->post("lists/LIST-ID/members", $args);
    echo ''; print_r($response->getBody()); echo '';
} catch(ResponseException $e) {
    echo $e->getStatusCode().'';
    echo $e->getTitle().'';
    echo $e->getType().'';
    echo $e->getDetail().'';
}
```

Or updating an existing subscriber of a list.

```
use SlickLabs\MailChimp\Subscriber;

$args = [
    "body" => [
        "status" => "subscribed"
    ]
];

$subscriberHash = Subscriber::hash("myemail@myemail.com");

try {
    $response = $MailChimp->put('lists/LIST-ID/members/'.$subscriberHash, $args);
    echo ''; print_r($response->getBody()); echo '';
} catch(ResponseException $e) {
    echo $e->getStatusCode().'';
    echo $e->getTitle().'';
    echo $e->getType().'';
    echo $e->getDetail().'';
}
```

Or deleting a subscriber of a list.

```
use SlickLabs\MailChimp\Subscriber;

$subscriberHash = Subscriber::hash("myemail@email.com");
try {
    $response = $MailChimp->delete("lists/LIST-ID/members/".$subscriberHash);
    echo ''; print_r($response->getBody()); echo '';
} catch(ResponseException $e) {
    echo $e->getStatusCode().'';
    echo $e->getTitle().'';
    echo $e->getType().'';
    echo $e->getDetail().'';
}
```

Installation
------------

[](#installation)

Add MailChimp to your `composer.json` file. If you are not using [Composer](http://getcomposer.org), you should be. It's an excellent way to manage dependencies in your PHP application.

```
{
  "require": {
    "slicklabs/mailchimp": "dev-master"
  }
}
```

Then at the top of your PHP script require the autoloader:

```
require 'vendor/autoload.php';
```

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

[](#contributing)

This is a fairly simple wrapper, but it can be made much better by contributions from those using it. 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

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8834dc84f62a7c139ded639124a4f9a3bfd03e8ccac75db9f83107ed38ebca39?d=identicon)[slicklabs](/maintainers/slicklabs)

---

Top Contributors

[![leoflapper](https://avatars.githubusercontent.com/u/2369607?v=4)](https://github.com/leoflapper "leoflapper (11 commits)")[![nathanjansen](https://avatars.githubusercontent.com/u/73473323?v=4)](https://github.com/nathanjansen "nathanjansen (3 commits)")[![rvanlaak](https://avatars.githubusercontent.com/u/2707563?v=4)](https://github.com/rvanlaak "rvanlaak (1 commits)")

### Embed Badge

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

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

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