Customer.io notification channel for Laravel
steadfastcollective/laravel-customer-io is a Laravel package for customer.io notification channel for laravel.
It currently has 2 GitHub stars and 3.625 downloads on Packagist (latest version 1.1.5).
Install it with composer require steadfastcollective/laravel-customer-io.
Discover more Laravel packages by steadfastcollective
or browse all Laravel packages to compare alternatives.
Last updated
This package makes it easy to send notifications using the Customer io API with Laravel.
The Customer io channel makes it possible to send out Laravel notifications as a Customer io event. The notifiable model data will also be synced with Customer io and kept up to date.
You can install the package via composer:
composer require steadfastcollective/laravel-customer-io
You will need to create a Customer io account to use this channel. Within your account, you will find the API key and the site ID. Place them inside your .env file:
CUSTOMER_IO_ENABLED=true
CUSTOMER_IO_SITE_ID=[SITE_ID]
CUSTOMER_IO_API_KEY=[API_KEY]
CUSTOMER_IO_MODEL=App\User
Add the trait to your notifiable model:
use Steadfastcollective\LaravelCustomerIo\Traits\SyncsToCustomerIo;
class User extends Authenticatable
{
use Notifiable, SyncsToCustomerIo;
// ...
}
Adding customer io support to the notification class:
use Steadfastcollective\LaravelCustomerIo\Channels\CustomerIoChannel;
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return [
CustomerIoChannel::class,
];
}
/**
* Get the customer io representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toCustomerIo($notifiable)
{
return [
// ...
];
}
}
Sync all customers with customer.io with a single command:
php artisan customer-io:sync-customers
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.