io-digital/clickatell is a Laravel package for clickatell notifications driver.
It currently has 0 GitHub stars and 3.141 downloads on Packagist (latest version 1.0.0).
Install it with composer require io-digital/clickatell.
Discover more Laravel packages by io-digital
or browse all Laravel packages to compare alternatives.
Last updated
This package makes it easy to send notifications using clickatell.com with Laravel 5.5+, 6.x & 7.x.
You can install the package via composer:
composer require io-digital/clickatell
Add your Clickatell user, password and api identifier to your config/services.php:
// config/services.php
...
'clickatell' => [
'api_key' => env('CLICKATELL_API_KEY'),
],
...
Number format: +27840000000
To route Clickatell notifications to the proper phone number, define a routeNotificationForClickatell method on your notifiable entity:
class User extends Authenticatable
{
use Notifiable;
/**
* Route notifications for the Nexmo channel.
*
* @param \Illuminate\Notifications\Notification $notification
* @return string
*/
public function routeNotificationForClickatell($notification)
{
return $this->phone_number;
}
}
You can use the channel in your via() method inside the notification:
use Illuminate\Notifications\Notification;
use IoDigital\Clickatell\ClickatellMessage;
use IoDigital\Clickatell\ClickatellChannel;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [ClickatellChannel::class];
}
public function toClickatell($notifiable)
{
return (new ClickatellMessage())
->content("Your {$notifiable->service} account was approved!");
}
}
Notification::route('clickatell', 'YOUR E164 NUMBER')
->notifyNow(new \App\Notifications\MyNotification($model));
Please see CHANGELOG for more information what has changed recently.
$ composer test
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Please see CONTRIBUTING for details.
The MIT License (MIT). Please see License File for more information.