Skip to content

fabioferreira3/laravel-customerio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CustomerIO Laravel package

. .

About

Installation

From your project folder:

  • Run composer require fabioferreira/customerio
  • Run php artisan vendor:publish --all

Then add the following keys to your .env file (you can grab the correct keys in the workspace integration settings page):

  • CUSTOMERIO_SITE_ID=your_workspace_site_id
  • CUSTOMERIO_API_KEY=your_workspace_api_key

Getting started

Laravel CustomerIO package provides a facade that you can just import and use virtually anywhere in your project:

Example:

use FabioFerreira\CustomerIO\Facades\CustomerIO;

Route::get('/create-customer', function () {

    $customerID = 123;
    $customerAttributes = ['first_name' => 'Fabio', 'email' => 'fabio86ferreira@gmail.com'];

    return CustomerIO::createCustomer($customerID, $customerAttributes);

 });

Available methods

Method Parameters Description
createCustomer string customerId, array customerAttributes Creates a new customer
updateCustomer string customerId, array customerAttributes Updates a customer by its ID
deleteCustomer string customerId Deletes a customer by its ID
triggerEventOnCustomer string customerId, string eventName, array eventAttributes Sends an event on a customer
triggerAnonymousEvent string eventName, array eventAttributes Sends an anonymous event

Contributing

Feel free to create issues and report bugs.

License

MIT

About

Customer.io Laravel package

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages