PHP code example of dubture / customerio-bundle
1. Go to this page and download the library: Download dubture/customerio-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
dubture / customerio-bundle example snippets
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'));
use Dubture\CustomerIOBundle\Event\WebHookEvent;
class WebhookListener
{
public function onClick(WebHookEvent $event)
{
$this->logger->info('Customer clicked on email with address: '
. $event->getEmail());
}
}