定制 dubture/customerio-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

dubture/customerio-bundle

最新稳定版本:0.0.1

Composer 安装命令:

composer require dubture/customerio-bundle

包简介

Integrates customer.io into Symfony

README 文档

README

Build Status Scrutinizer Code Quality

Latest Stable Version Total Downloads License

Symfony integration for http://customer.io.

Configuration

Install the bundle using composer and register it in your Kernel.

Then configure your site_id and api_key:

# app/config/config.yml

dubture_customer_io:
  site_id: <YOUR-SITE-ID>
  api_key: <YOUR-API-KEY>

Usage

Customer model

Implement Dubture\CustomerIOBundle\Model\CustomerInterface on your customer domain class.

Event Tracking / Customer identification

use Dubture\CustomerIOBundle\Event\TrackingEvent;
use Dubture\CustomerIOBundle\Event\ActionEvent;

/** @var \Symfony\Component\EventDispatcher\EventDispatcher $tracker */
$dispatcher = $this->getContainer()->get('event_dispatcher');

$customer = $someRepo->getCustomer(); // retrieve your customer domain object

// send the customer over to customer.io for identification
$dispatcher->dispatch(TrackingEvent::IDENTIFY, new TrackingEvent($customer));

// now track a `click` event
$dispatcher->dispatch(TrackingEvent::ACTION, new ActionEvent($customer, 'click'));

Webhooks

The bundle comes with a controller which can consume customer.io webhooks.

To use them, register the routing.xml:

# app/config/routing.yml

customerio_hooks:
    resource: "@DubtureCustomerIOBundle/Resources/config/routing.xml"

Now your hook url will be http://your.project.com//__dubture/customerio which you need to configure over at customer.io.

After doing so, you can listen to webhook events:

<service id="acme.webhooklistener" class="Acme\DemoBundle\Listener\WebhookListener">
    <tag name="kernel.event_listener" event="customerio.email_clicked" method="onClick" />
</service>
use Dubture\CustomerIOBundle\Event\WebHookEvent;

class WebhookListener
{
    public function onClick(WebHookEvent $event)
    {
        $this->logger->info('Customer clicked on email with address: '
        . $event->getEmail());
    }
}

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-12