mothership-ec/cog-mothership-mailing 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 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

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 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`

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 我们能提供哪些服务?
定制开发 / 二次开发

基于 mothership-ec/cog-mothership-mailing 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 377
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 29
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2015-10-19