PHPackages                             mocean/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. [Mail &amp; Notifications](/categories/mail)
4. /
5. mocean/mailchimp

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

mocean/mailchimp
================

Mailchimp Integration with Mocean API

1.0.0(7y ago)13MITPHPPHP &gt;=5.3.0

Since Jan 2Pushed 4y agoCompare

[ Source](https://github.com/MoceanAPI/mocean-mailchimp)[ Packagist](https://packagist.org/packages/mocean/mailchimp)[ Docs](http://moceanapi.com)[ RSS](/packages/mocean-mailchimp/feed)WikiDiscussions master Synced 3d ago

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

Mocean Mailchimp
================

[](#mocean-mailchimp)

Mailchimp integration with [Mocean Api](moceanapi.com)

Try for FREE now. 20 trial SMS credits will be given upon [registration](http://dashboard.moceanapi.com/register?fr=mailchimp). Additional SMS credits can be requested and is subject to approval by MoceanAPI.

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

[](#installation)

To install the library, run this command in terminal.

```
composer require mocean/mailchimp
```

### Configuration

[](#configuration)

default config list

```
'MOCEAN_API_VERSION' => '1',
'MOCEAN_API' => 'rest.moceanapi.com/rest',
'MOCEAN_API_KEY' => '',
'MCOEAN_API_SECRET' => '',
'MOCEAN_API_SENDER_ID' => '', //for mocean-from field (leave empty to use mailchimp list name as sender id)
'MOCEAN_API_TEXT' => 'Testing Text',

'MAILCHIMP_API_VERSION' => '3.0',
'MAILCHIMP_API' => 'api.mailchimp.com',
'MAILCHIMP_API_KEY' => '',
'MAILCHIMP_LISTS_SEARCH_NAME' => '', //search for mailchimp list to be used (leave this empty to use all lists)
'MAILCHIMP_CAMPAIGNS_SEARCH_TITLE' => '', //search for campaign title to be used (leave this empty to use all campaigns)

'ALLOW_DUPLICATE_MEMBER' => false, //set to true if the you wish to send to the same member in different list multiple time
```

Usage
-----

[](#usage)

If you're using composer, make sure the autoloader is included in your project's bootstrap file:

```
require_once "vendor/autoload.php";
```

Setup your configuration

```
$config = array(
    'MOCEAN_API_KEY' => 'xxxx',
    'MCOEAN_API_SECRET' => 'xxxx',
    'MOCEAN_API_TEXT' => 'Testing Text',

    'MAILCHIMP_API_KEY' => 'xxxx-xxx',
);
```

Create a Mailchimp object

```
$mailchimp = new Mocean\Mailchimp\Mailchimp($config);
```

Broadcast message through campaign

```
$totalSmsSent = $mailchimp->campaigns()->lists()->members()->broadcast();
echo "Total SMS Sent: $totalSmsSent";
```

Broadcast message through lists

```
$totalSmsSent = $mailchimp->lists()->members()->broadcast();
echo "Total SMS Sent: $totalSmsSent";
```

Broadcast by passing in custom text parameter (default using text in config)

```
broadcast('custom text');
```

Sometime, you would not using all campaign or list, this library provide a convenient method which you can set it in config

```
//seperate multiple name by (,)
$config => array(
    'MAILCHIMP_LISTS_SEARCH_NAME' => 'First List,Second List',
    'MAILCHIMP_CAMPAIGNS_SEARCH_TITLE' => 'First Campaign,Second Campaign',
);
```

Use `get()` if you wish to get the response data from mailchimp

```
$campaignResponse = $mailchimp->campaigns()->get();
$listResponse = $mailchimp->lists()->get();
$memberResponse = $mailchimp->lists()->members()->get();
```

Dynamically set configuration (always override current config)

```
$mailchimp->setConfig($config);
```

### API Errors

[](#api-errors)

In the event of any api errors occured, the object you request will return false and you can get the specific error msg from the api class

```
$campaigns = $mailChimp->campaigns();
if($campaigns === false){
    echo Mocean\Mailchimp\api\MailChimpApi::$errMsg;
}
```

### Exceptions

[](#exceptions)

A `Mocean\Mailchimp\exceptions\CampaignNotFoundException` is thrown if the account dont have any campaign or unable to search the campaign in config

A `Mocean\Mailchimp\exceptions\ListNotFoundException` is thrown if the account dont have any list or unable to search the list in config

A `Mocean\Mailchimp\exceptions\MemberNotFoundException` is thrown if the list dont have any member

A `Mocean\Mailchimp\exceptions\InvalidKeyException` is thrown if there's key credential error

A `Mocean\Mailchimp\exceptions\ConfigKeyNotFoundException` is thrown if there's error in config key name

Example
-------

[](#example)

there's an example on usage in folder `example/example.php`

License
-------

[](#license)

This library is released under the [MIT License](LICENSE)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

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

2690d ago

### Community

Maintainers

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

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

---

Top Contributors

[![lkloon123](https://avatars.githubusercontent.com/u/21114981?v=4)](https://github.com/lkloon123 "lkloon123 (3 commits)")[![mikalim](https://avatars.githubusercontent.com/u/76044249?v=4)](https://github.com/mikalim "mikalim (1 commits)")

---

Tags

broadcastintegrationmailchimpmoceanapisms-messagesemailsmsmailchimpmocean

### Embed Badge

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

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

###  Alternatives

[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)[symfony/fake-sms-notifier

Fake SMS (as email or log during development) Notifier Bridge.

27754.2k1](/packages/symfony-fake-sms-notifier)[tuyakhov/yii2-notifications

The extension provides support for sending notifications across a variety of delivery channels, including mail, SMS, Slack etc. Notifications may also be stored in a database so they may be displayed in your web interface.

6735.5k2](/packages/tuyakhov-yii2-notifications)[ferdous/laravel-otp-validate

Laravel package for OTP validation with built-in features like retry and resend mechanism. Built in max retry and max resend blocking. OTP/Security Code can be send over SMS or Email of your choice with user-defined template.

7124.4k](/packages/ferdous-laravel-otp-validate)[oneup/contao-mailchimp

This extension connects a Contao installation with MailChimp.

1215.3k](/packages/oneup-contao-mailchimp)[juanparati/brevosuite

Complete Brevo integration with Laravel

1010.8k](/packages/juanparati-brevosuite)

PHPackages © 2026

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