This package makes it easy to send notifications using clickatell.com with Laravel 5.5+, 6.x, 7.x, 8.x & 9.x.
You can install the package via composer:
composer require laravel-notification-channels/clickatell
Add your Clickatell user, password and api identifier to your config/services.php
:
// config/services.php
...
'clickatell' => [
'api_key' => env('CLICKATELL_API_KEY'),
'api_id' => env('CLICKATELL_API_ID')
],
...
You can use the channel in your via()
method inside the notification:
use Illuminate\Notifications\Notification;
use NotificationChannels\Clickatell\ClickatellMessage;
use NotificationChannels\Clickatell\ClickatellChannel;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [ClickatellChannel::class];
}
public function toClickatell($notifiable)
{
return ClickatellMessage::create()
->setNumber("Phone_Number")
->setMessage("Your {$notifiable->service} account was approved!");
}
}
use Illuminate\Notifications\Notification;
use NotificationChannels\Clickatell\ClickatellMessage;
use NotificationChannels\Clickatell\ClickatellChannel;
class AccountApproved extends Notification
{
public function via($notifiable)
{
return [ClickatellChannel::class];
}
public function toClickatell($notifiable)
{
return ClickatellMessage::create(
"Phone_Number",
"Your {$notifiable->service} account was approved!"
);
}
}
TODO
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.
- etiennemarais
- arcturial
- For the Clickatell Client implementation which I leverage on for this wrapper
The MIT License (MIT). Please see License File for more information.