verifiedit / laravel-notification-channel-clicksend
ClickSend notification channel for Laravel
Installs: 4 165
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=8.0
- ext-json: *
- illuminate/config: ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
- illuminate/events: ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
- illuminate/notifications: ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
- illuminate/queue: ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
- illuminate/support: ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0 || ^11.0
- verifiedit/clicksend-sms: ^0.2 || ^0.3 || ^1.0
Requires (Dev)
- laravel/pint: ^v1.0
- mockery/mockery: ^1.0
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2024-10-25 09:47:24 UTC
README
Please see this repo for instructions on how to submit a channel proposal.
A Boilerplate repo for contributions
This package makes it easy to send notifications using ClickSend with Laravel 5.5+, 6.x, 7.x, 8.x, 9.x, 10.x and 11.x.
Contents
Installation
You can install the package via composer:
$ composer require verifiedit/laravel-notification-channel-clicksend
Setting up the ClickSend service
Add your ClikSend details to your .env:
CLICKSEND_DRIVER=clicksend
CLICKSEND_ENABLED=true
CLICKSEND_USERNAME=XYZ
CLICKSEND_APIKEY=XYZ
CLICKSEND_SMS_FROM=XYZ
Usage
You can use the channel in your via() method inside the notification:
use NotificationChannels\ClickSend\ClickSendChannel; use NotificationChannels\ClickSend\ClickSendMessage; use Illuminate\Notifications\Notification; class AccountApproved extends Notification { public function via($notifiable) { return [ClickSendChannel::class]; } public function toClickSend($notifiable) { return (new ClickSendMessage()) ->setContent("Your {$notifiable->service} account was approved!"); } }
In order to let your Notification know which phone are you sending/calling to, the channel will look for the phone_number attribute of the Notifiable model. If you want to override this behaviour, add the routeNotificationForClickSend method to your Notifiable model.
public function routeNotificationForClickSend() { return $this->phone_number; }
Changelog
Please see CHANGELOG for more information what has changed recently.
Testing
$ composer test
Security
If you discover any security related issues, please email developers@verified.com.au instead of using the issue tracker.
Contributing
Please see CONTRIBUTING for details.
Credits
License
The MIT License (MIT). Please see License File for more information.