PHP code example of oscar-team / customerio-laravel

1. Go to this page and download the library: Download oscar-team/customerio-laravel 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/ */

    

oscar-team / customerio-laravel example snippets


$customerIo = CustomerIo::workspace();

$customerIo = CustomerIo::workspace('us_market');

$isCustomer = $customerIo->searchCustomerByEmail($email);

$customerData = [
    'id' => 1
    'email' => '[email protected]',
    'first_name' => 'john',
    'last_name' => 'doe',
];
$customerIo->addCustomer($customerData);

$customerData = [
    'id' => 1
    'email' => '[email protected]',
    'first_name' => 'Doe',
    'last_name' => 'John',
];
$customerIo->updateCustomer($customerData);

$eventData = [
    'id' => 1
    'email' => '[email protected]',
    'name' => 'Event Created',
    'data' => []
];
$customerIo->createEvent($eventData);
bash
php artisan vendor:publish --tag=customerio-config