PHPackages                             chimpmatic/mailchimp-subscriber - 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. chimpmatic/mailchimp-subscriber

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

chimpmatic/mailchimp-subscriber
===============================

Subscribe contacts to Mailchimp audiences with merge fields. Clean OOP, zero dependencies, PHP 8.5+.

v1.0.0(1mo ago)00MITPHPPHP &gt;=8.5

Since Mar 17Pushed 1mo agoCompare

[ Source](https://github.com/chimpmatic/mailchimp-subscriber)[ Packagist](https://packagist.org/packages/chimpmatic/mailchimp-subscriber)[ Docs](https://chimpmatic.com)[ RSS](/packages/chimpmatic-mailchimp-subscriber/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Mailchimp Subscriber
====================

[](#mailchimp-subscriber)

[![Latest Version](https://camo.githubusercontent.com/2148c64ad4c93ee1440c2545e3023fb208711e014bb8e5f90d4f277518f171e8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6368696d706d617469632f6d61696c6368696d702d737562736372696265722e737667)](https://packagist.org/packages/chimpmatic/mailchimp-subscriber)[![PHP Version](https://camo.githubusercontent.com/9db61b2db75d268397862286fb2d8eb559a9adbe220d3ad16605467ff837358c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6368696d706d617469632f6d61696c6368696d702d737562736372696265722e737667)](https://packagist.org/packages/chimpmatic/mailchimp-subscriber)[![License](https://camo.githubusercontent.com/9e290c0a08e81a53ccd01e580e8496c72f0f47a4e972667b753e094777fc679b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6368696d706d617469632f6d61696c6368696d702d737562736372696265722e737667)](https://github.com/chimpmatic/mailchimp-subscriber/blob/main/LICENSE)

Subscribe contacts to Mailchimp audiences with merge fields. Clean OOP, zero dependencies, PHP 8.5+.

**Author:** [Chimpmatic](https://chimpmatic.com)

Why This Exists
---------------

[](#why-this-exists)

Adding a subscriber to Mailchimp through the API requires building the right payload, hashing the email, choosing the correct endpoint, and handling upsert logic. This library wraps all of that into a single method call.

Built for [Contact Form 7 to Mailchimp](https://chimpmatic.com/connect-contact-form-7-with-mailchimp) integrations, but works with any PHP application.

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

[](#requirements)

- **PHP 8.5 or higher** (uses `readonly` classes and enums)
- `curl` extension

A fatal error (`E_USER_ERROR`) is triggered if loaded on PHP &lt; 8.5. The library will not run on older versions.

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

[](#installation)

```
composer require chimpmatic/mailchimp-subscriber
```

Quick Start
-----------

[](#quick-start)

```
use Chimpmatic\Subscriber\Subscriber;
use Chimpmatic\Subscriber\Contact;

$subscriber = new Subscriber('your-api-key-us4');

$contact = new Contact('john@example.com', [
    'FNAME' => 'John',
    'LNAME' => 'Doe',
]);

$result = $subscriber->subscribe('abc123def4', $contact);

echo $result->getSummary();
// "Added john@example.com to audience abc123def4 — status: subscribed"
```

Subscribe with Merge Fields
---------------------------

[](#subscribe-with-merge-fields)

```
use Chimpmatic\Subscriber\Subscriber;
use Chimpmatic\Subscriber\Contact;

$subscriber = new Subscriber('your-api-key-us4');

$contact = new Contact('jane@example.com', [
    'FNAME'    => 'Jane',
    'LNAME'    => 'Smith',
    'BIRTHDAY' => '03/15',
    'PHONE'    => '+1-555-0100',
]);

$result = $subscriber->subscribe('abc123def4', $contact);

if ($result->isSubscribed()) {
    echo "Subscribed successfully!";
}
```

Convenience Method
------------------

[](#convenience-method)

```
// Skip creating a Contact object
$result = $subscriber->subscribeEmail(
    audienceId: 'abc123def4',
    email: 'user@example.com',
    mergeFields: ['FNAME' => 'User'],
);
```

Double Opt-In (Pending)
-----------------------

[](#double-opt-in-pending)

```
use Chimpmatic\Subscriber\SubscriptionStatus;

$result = $subscriber->subscribe(
    audienceId: 'abc123def4',
    contact: $contact,
    status: SubscriptionStatus::Pending,
);

if ($result->isPending()) {
    echo "Confirmation email sent!";
}
```

Check Member Status
-------------------

[](#check-member-status)

```
$status = $subscriber->getMemberStatus('abc123def4', 'user@example.com');

if ($status === null) {
    echo "Not subscribed";
} else {
    echo $status->value; // "subscribed", "pending", "unsubscribed", etc.
}
```

Error Handling
--------------

[](#error-handling)

```
use Chimpmatic\Subscriber\ApiException;

try {
    $subscriber = new Subscriber('your-api-key-us4');
    $subscriber->subscribeEmail('abc123def4', 'user@example.com');
} catch (\InvalidArgumentException $e) {
    // Bad API key format or invalid email
} catch (ApiException $e) {
    // API error (401, 404, network failure)
}
```

Finding Your Audience ID
------------------------

[](#finding-your-audience-id)

Need to find your Audience ID and merge fields? Use [mailchimp-audience-finder](https://packagist.org/packages/chimpmatic/mailchimp-audience-finder):

```
composer require chimpmatic/mailchimp-audience-finder
```

Need your API key first? See [How to Get Your Mailchimp API Key](https://chimpmatic.com/how-to-get-your-mailchimp-api-key).

For a guide on merge fields and tags, see [Mailchimp Audience Fields and Merge Tags](https://chimpmatic.com/mailchimp-audience-fields-and-merge-tags).

Links
-----

[](#links)

- [Packagist](https://packagist.org/packages/chimpmatic/mailchimp-subscriber)
- [GitHub](https://github.com/chimpmatic/mailchimp-subscriber)
- [Issues](https://github.com/chimpmatic/mailchimp-subscriber/issues)
- [Connect Contact Form 7 with Mailchimp](https://chimpmatic.com/connect-contact-form-7-with-mailchimp)
- [How to Get Your Mailchimp API Key](https://chimpmatic.com/how-to-get-your-mailchimp-api-key)
- [Mailchimp Audience Fields and Merge Tags](https://chimpmatic.com/mailchimp-audience-fields-and-merge-tags)
- [Chimpmatic — Contact Form 7 to Mailchimp](https://chimpmatic.com)

License
-------

[](#license)

MIT License. Copyright (c) 2026 [Chimpmatic](https://chimpmatic.com).

###  Health Score

40

—

FairBetter than 87% of packages

Maintenance95

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

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

53d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e0fe8014730461a907cfbc1b54ca0783ef523afa729ea89739cf96feaa78880e?d=identicon)[chimpmatic](/maintainers/chimpmatic)

---

Top Contributors

[![chimpmatic](https://avatars.githubusercontent.com/u/73747745?v=4)](https://github.com/chimpmatic "chimpmatic (1 commits)")

---

Tags

wordpressmailchimpemail marketingsubscribeAudiencecontact-form-7mailchimp-apimerge-fields

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-newsletter

Manage Mailcoach and MailChimp newsletters in Laravel

1.6k6.3M26](/packages/spatie-laravel-newsletter)[mageplaza/module-smtp

SMTP Extension for Magento 2 helps the owner of store simply install SMTP (Simple Mail Transfer Protocol) server which transmits the messages into codes or numbers

3015.9M8](/packages/mageplaza-module-smtp)[thinkshout/mailchimp-api-php

PHP library for v3 of the MailChimp API

824.6M1](/packages/thinkshout-mailchimp-api-php)[humanmade/aws-ses-wp-mail

WordPress plugin to send mail via SES

188250.3k3](/packages/humanmade-aws-ses-wp-mail)[itinerisltd/wp-phpmailer

WP PHPMailer provides a clean and simple way to configure WordPress-bundled PHPMailer library, allowing you to quickly get started sending mail through a local or cloud based service of your choice.

6231.6k](/packages/itinerisltd-wp-phpmailer)[salamwaddah/laravel-mandrill-driver

Mandrill notification channel for Laravel 5, 6, 7, 8, 9, 10, 11, 12

1174.3k](/packages/salamwaddah-laravel-mandrill-driver)

PHPackages © 2026

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