PHPackages                             mothership-ec/cog-mothership-mailing - 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. mothership-ec/cog-mothership-mailing

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

mothership-ec/cog-mothership-mailing
====================================

Mothership module for mailings, with synchronisation to popular third-party systems

1.1.0(10y ago)03771GPL-3.0+PHPPHP &gt;=5.4.0

Since Oct 19Pushed 10y ago3 watchersCompare

[ Source](https://github.com/mothership-ec/cog-mothership-mailing)[ Packagist](https://packagist.org/packages/mothership-ec/cog-mothership-mailing)[ Docs](http://mothership.ec)[ RSS](/packages/mothership-ec-cog-mothership-mailing/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependencies (3)Versions (4)Used By (0)

Mothership Mailing
==================

[](#mothership-mailing)

The `Message\Mothership\Mailing` module provides functionality for users to decide whether they are subscribed to receive marketing emails.

This module comes only with the framework for integrating with third party email marketing software, but does not come with any native support.

Intergrating third parties
--------------------------

[](#intergrating-third-parties)

### Implementing the AdapterInterface

[](#implementing-the-adapterinterface)

To integrate third party software, you must create a class that implements the `Message\Mothership\Mailing\ThirdParty\Sync\AdapterInterface` interface.

This interface contains the following methods:

- **`getName()`** - This method must return a string that represents how the adapter will be referred to in the collection and in the `mailing.yml` config
- **`getAllSubscribers(\DateTime $since = null)`** - This method should connect to the third party software and collect all existing subscribers (even if they have unsubscribed). If it is given an instance of `Datetime` then it should return only email addresses which have been modified since that time.
- **`getSubscriber($email)`** - This method should get the details of a specific email address from the third party
- **`subscribe(\Message\Mothership\Mailing\SubscriberInterface $subscriber)`** - This method should subscribe an email address to the marketing campaign. This module comes packaged with the `Message\Mothership\Mailing\Subscription\Subscriber` class which implements `Message\Mothership\Mailing\SubscriberInterface` interface. This class contains basic information about the subscriber which can be saved to and loaded from the database
- **`unsubscribe(\Message\Mothership\Mailing\SubscriberInterface $subscriber)`** - This method should unsubscribe the email address from the marketing campaign
- **`isSyncable()`** - This method determines whether or not it is possible to automatically synchronise the subscriber information stored in the database with the third party software. If this is returns false then email addresses will need to be subscribed manually

### Implementing the third party adapter

[](#implementing-the-third-party-adapter)

Once you have written your third party adapter class, you will need to add it to the adapter collection via the service container.

To do this, extend the `mailing.sync.adapter.collection` service and add it, like so:

```
$services->extend('mailing.sync.adapter.collection', function ($collection, $c) {

    // Where 'MyAdapterClass' is the third party adapter that implements
    // the AdapterInterface
    $collection->add(new MyAdapterClass);

    return $collection;
});
```

You will then need to add the return value of the `getName()` method to the `mailing.yml` file, so if it returns 'my-adapter', the config would look like this:

```
sync:
    enabled: false
    adapter: my-adapter

```

Synchronising with the third party
----------------------------------

[](#synchronising-with-the-third-party)

This module uses a cron to synchronise with the third party software every hour. To enable this

- You must ensure that your adapter class' `isSyncable()` method returns `true`.
- You should then ensure that it is enabled in the `mailing.yml` file:

```
sync:
    enabled: true
    adapter: my-adapter

```

- You must set up the `crontab` on the server to run all Mothership scheduled tasks. This is not used soley for mailing and should be set up on all Mothership installations. However, to set it up run `crontab -e` in the terminal, and then add the following line:

```
# Fill in the path as applicable
* * * * * /[path to your installation]/bin/cog task:run_scheduled --env=live > /dev/null`

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

Every ~43 days

Total

2

Last Release

3820d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4520924?v=4)[Thomas Marchant](/maintainers/thomasjthomasj)[@thomasjthomasj](https://github.com/thomasjthomasj)

---

Top Contributors

[![thomasjthomasj](https://avatars.githubusercontent.com/u/4520924?v=4)](https://github.com/thomasjthomasj "thomasjthomasj (19 commits)")

---

Tags

emailmailchimpcampaignnewslettermailingmothershipCampaign Monitormailings

### Embed Badge

![Health badge](/badges/mothership-ec-cog-mothership-mailing/health.svg)

```
[![Health](https://phpackages.com/badges/mothership-ec-cog-mothership-mailing/health.svg)](https://phpackages.com/packages/mothership-ec-cog-mothership-mailing)
```

###  Alternatives

[spatie/laravel-newsletter

Manage Mailcoach and MailChimp newsletters in Laravel

1.6k6.3M26](/packages/spatie-laravel-newsletter)[putyourlightson/craft-campaign

Send and manage email campaigns, contacts and mailing lists.

6435.0k1](/packages/putyourlightson-craft-campaign)[hocza/sendy

Sendy API implementation for Laravel

71195.5k](/packages/hocza-sendy)[ecomailcz/ecomail

Ecomail.cz API Wrapper

17383.8k4](/packages/ecomailcz-ecomail)

PHPackages © 2026

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