mothership-ec/cog-mothership-mailing
最新稳定版本:1.1.0
Composer 安装命令:
composer require mothership-ec/cog-mothership-mailing
包简介
Mothership module for mailings, with synchronisation to popular third-party systems
README 文档
README
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.ymlconfiggetAllSubscribers(\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 ofDatetimethen 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\Subscriberclass which implementsMessage\Mothership\Mailing\SubscriberInterfaceinterface. 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:
$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
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.ymlfile:
sync:
enabled: true
adapter: my-adapter
- You must set up the
crontabon 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 -ein 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`
mothership-ec/cog-mothership-mailing 适用场景与选型建议
mothership-ec/cog-mothership-mailing 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 377 次下载、GitHub Stars 达 0, 最近一次更新时间为 2015 年 10 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「mailchimp」 「newsletter」 「email」 「mailing」 「Campaign Monitor」 「campaign」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mothership-ec/cog-mothership-mailing 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mothership-ec/cog-mothership-mailing 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mothership-ec/cog-mothership-mailing 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
MailChimp OAuth 2.0 Client Provider for The PHP League OAuth2-Client
Manage newsletters in Laravel
The Automated Provision of Email Services (APES) module will allow you to set up an automated sync mechanism between the SilverStripe Member DataObject and MailChimp.
Extensible library for building notifications and sending them via different delivery channels.
Email+ extends Kirby's email capabilities by adding support for multiple email services using the same Kirby email API.
Sendrill DB
统计信息
- 总下载量: 377
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 29
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-10-19