chrisbraybrooke/sendinblue-tracker

There is no license information available for the latest version (0.0.2) of this package.

0.0.2 2019-07-29 20:49 UTC

This package is auto-updated.

Last update: 2024-10-29 06:05:34 UTC


README

Installation

composer require chrisbraybrooke/sendinblue-tracker

Laravel Usage

Laravel will autodiscover our service provider and register the alias. The only additional setup is to add the following to your config/services.php and .ENV files.

// config/services.php

'sendinblue' => [
    'tracker_id' => env('SENDINBLUE_TRACKER_ID'),
],

We are now able to use the available methods to communicate with sendinblue.

Identify

The is the primary way to create a new user within sendinblue or update an exsisting one. The primary way of indentifying users is via their email address.

use SendinBlueTracker;

SendinBlueTracker::identify('christian.braybrooke@gmail.com', [
    'FIRSTNAME' => 'Christian',
    'LASTNAME' => 'Braybrooke'
]);

Event

The next method is how we fire an event within sendinblue, this can be used to trigger workflows and other types of automation.

use SendinBlueTracker;

SendinBlueTracker::event(
    'christian.braybrooke@gmail.com',
    'eventName',
  	// Event Data
    [
      'CTA_URL' => 'https://www.example.com',
      'COST' => '20.00'
    ],
  	// User Data
    [
      'FIRSTNAME' => 'Chris'
    ],
);