Download the PHP package mothership-ec/cog-mothership-mailing without Composer
On this page you can find all versions of the php package mothership-ec/cog-mothership-mailing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mothership-ec/cog-mothership-mailing
More information about mothership-ec/cog-mothership-mailing
Files in mothership-ec/cog-mothership-mailing
Package cog-mothership-mailing
Short Description Mothership module for mailings, with synchronisation to popular third-party systems
License GPL-3.0+
Homepage http://mothership.ec
Informations about the package cog-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
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 themailing.yml
configgetAllSubscribers(\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 ofDatetime
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 partysubscribe(\Message\Mothership\Mailing\SubscriberInterface $subscriber)
- This method should subscribe an email address to the marketing campaign. This module comes packaged with theMessage\Mothership\Mailing\Subscription\Subscriber
class which implementsMessage\Mothership\Mailing\SubscriberInterface
interface. This class contains basic information about the subscriber which can be saved to and loaded from the databaseunsubscribe(\Message\Mothership\Mailing\SubscriberInterface $subscriber)
- This method should unsubscribe the email address from the marketing campaignisSyncable()
- 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
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:
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:
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 returnstrue
. -
You should then ensure that it is enabled in the
mailing.yml
file: - 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 runcrontab -e
in the terminal, and then add the following line:
All versions of cog-mothership-mailing with dependencies
mothership-ec/cog Version ~4.0
mothership-ec/cog-mothership-reports Version ~2.2
mothership-ec/cog-mothership-user Version ~4.0