fabioferreira / customerio
Customer IO Laravel package
v1.2
2020-09-07 19:36 UTC
Requires
- php: >=7.4
This package is auto-updated.
Last update: 2025-04-08 06:00:08 UTC
README
. | . |
---|---|
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.