PHPackages                             mailmotor/mailchimp-bundle - 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. mailmotor/mailchimp-bundle

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

mailmotor/mailchimp-bundle
==========================

This Symfony2 bundle loads in MailChimp as a service. So you can subscribe/unsubscribe members to MailChimp.

4.0.0(3y ago)4198.9k—6.8%51MITPHPPHP ^7.4||^8.0

Since Nov 27Pushed 1mo ago1 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (40)Used By (1)

MailChimpBundle
===============

[](#mailchimpbundle)

> Subscribing/Unsubscribing to your own mailinglist has never been this easy! Thanks to this Symfony2 bundle.

Examples
--------

[](#examples)

### Configure (MailChimp)

[](#configure-mailchimp)

```
composer require mailmotor/mailchimp-bundle
```

```
public function registerBundles()
{
    $bundles = array(
        // ...
        new MailMotor\Bundle\MailMotorBundle\MailMotorMailMotorBundle(),
        new MailMotor\Bundle\MailChimpBundle\MailMotorMailChimpBundle(),
    );
```

```
mailmotor.mail_engine:  'mailchimp'
mailmotor.api_key:      xxx # enter your mailchimp api_key here
mailmotor.server:       xxx # enter your mailchimp server prefix here (f.e. us1)
mailmotor.list_id:      xxx # enter the mailchimp default list_id here
```

### Subscribing

[](#subscribing)

```
$this->get('mailmotor.subscriber')->subscribe(
    $email,         // f.e.: 'info@jeroendesloovere.be'
    $language,      // f.e.: 'nl'
    $mergeFields,   // f.e.: ['FNAME' => 'Jeroen', 'LNAME' => 'Desloovere']
    $interests,     // f.e.: ['9A28948d9' => true, '8998ASAA' => false]
    $doubleOptin,   // OPTIONAL, default = true
    $listId         // OPTIONAL, default listId is in your config parameters
);
```

### Unsubscribing

[](#unsubscribing)

```
$this->get('mailmotor.subscriber')->unsubscribe(
    $email,
    $listId // OPTIONAL, default listId is in your config parameters
);
```

### Exists

[](#exists)

```
$this->get('mailmotor.subscriber')->exists(
    $email,
    $listId // OPTIONAL, default listId is in your config parameters
);
```

### Is subscribed

[](#is-subscribed)

```
$this->get('mailmotor.subscriber')->isSubscribed(
    $email,
    $listId // OPTIONAL, default listId is in your config parameters
);
```

### Full example for subscribing

[](#full-example-for-subscribing)

```
use MailMotor\Bundle\MailMotorBundle\Exception\NotImplementedException;

// Don't forget to add validation to your $email
$email = 'info@jeroendesloovere.be';

try {
    if ($this->get('mailmotor.subscriber')->isSubscribed($email)) {
        // Add error to your form
    }
// Fallback for when no mailmotor parameters are defined
} catch (NotImplementedException $e) {
    // Do nothing
}

if ($noErrors)
    try {
        // Subscribe the user to our default group
        $this->get('mailmotor.subscriber')->subscribe(
            $email,
            $language,
            $mergeFields
        );
    // Fallback for when no mailmotor parameters are defined
    } catch (NotImplementedException $e) {
        // Add you own code here to f.e.: send a mail to the admin
    }
}
```

### Full example for unsubscribing

[](#full-example-for-unsubscribing)

```
use MailMotor\Bundle\MailMotorBundle\Exception\NotImplementedException;

// Don't forget to add validation to your $email
$email = 'info@jeroendesloovere.be';

try {
    // Email exists
    if ($this->get('mailmotor.subscriber')->exists($email)) {
        // User is already unsubscribed
        if ($this->get('mailmotor.subscriber')->isUnsubscribed($email)) {
            // Add error to your form: "User is already unsubscribed"
        }
    // Email not exists
    } else {
        // Add error to your form: "email is not in mailinglist"
    }
// Fallback for when no mailmotor parameters are defined
} catch (NotImplementedException $e) {
    // Do nothing
}

if ($noErrors) {
    try {
        // Unsubscribe the user
        $this->get('mailmotor.subscriber')->unsubscribe($email);
    // Fallback for when no mailmotor parameters are defined
    } catch (NotImplementedException $e) {
        // We can send a mail to the admin instead
    }
}
```

Extending
---------

[](#extending)

### Creating a bundle for another mail engine.

[](#creating-a-bundle-for-another-mail-engine)

F.e.: You want to use a mail engine called "Crazy".

```
public function registerBundles()
{
    $bundles = array(
        // ...
        new Crazy\Bundle\MailMotorBundle\CrazyMailMotorBundle(),
    );
```

In **app/config/parameters.yml**

```
mailmotor.mail_engine:  'crazy'
mailmotor.api_key:      xxx # enter your crazy api_key here
mailmotor.list_id:      xxx # enter the crazy default list_id here
```

Then you just need to duplicate all files from another mail engine, like f.e.: "mailmotor/mailchimp-bundle" and replace all the logic for your own mail engine.

Credits
-------

[](#credits)

- Jeroen Desloovere - [Github](https://github.com/jeroendesloovere), [Website](http://jeroendesloovere.be)

###  Health Score

53

—

FairBetter than 97% of packages

Maintenance59

Moderate activity, may be stable

Popularity38

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

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

Every ~78 days

Recently: every ~352 days

Total

35

Last Release

1159d ago

Major Versions

0.1.1 → 1.0.02015-11-27

1.5.1 → 2.0.02016-12-01

2.0.0 → 3.0.02017-06-20

3.0.7 → 4.0.02023-03-16

PHP version history (3 changes)0.0.1PHP &gt;=5.3.3

3.0.0PHP ^7.1

4.0.0PHP ^7.4||^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/588616?v=4)[Jeroen Desloovere](/maintainers/jeroendesloovere)[@jeroendesloovere](https://github.com/jeroendesloovere)

---

Top Contributors

[![jeroendesloovere](https://avatars.githubusercontent.com/u/588616?v=4)](https://github.com/jeroendesloovere "jeroendesloovere (90 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![alessandrocraeye](https://avatars.githubusercontent.com/u/33480369?v=4)](https://github.com/alessandrocraeye "alessandrocraeye (1 commits)")[![carakas](https://avatars.githubusercontent.com/u/3634654?v=4)](https://github.com/carakas "carakas (1 commits)")

---

Tags

mail-enginemailchimpmailchimp-bundlemailinglistphpsymfony-bundlephpbundleSymfony2

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[redjanym/fcm-bundle

A Symfony Bundle for projects to send notifications in mobile devices through Firebase Cloud Messaging HTTP V1 API

43453.0k](/packages/redjanym-fcm-bundle)[jeroendesloovere/vcard-bundle

This Symfony 2 bundle can generate vCards with lots of data. When using an &lt; iOS 7 device it will export as a .ics file because iOS devices don't support the default .vcf files.

1677.3k3](/packages/jeroendesloovere-vcard-bundle)[supertag/gearman-bundle

Gearman bundle for Symfony2 to manage and monitor PHP gearman jobs and queue

1441.3k](/packages/supertag-gearman-bundle)

PHPackages © 2026

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