marjose123 / laravel-zoho-cliq-alert
Quickly send a message to Zoho Cliq Channels.
Fund package maintenance!
MarJose123
Requires
- php: ^8.3|^8.4
- illuminate/contracts: ^11.0|^12.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9||^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^10.0.0||^9.0.0||^8.22.0
- pestphp/pest: ^3.0
- pestphp/pest-plugin-arch: ^3.0
- pestphp/pest-plugin-laravel: ^3.0
- phpstan/phpstan-deprecation-rules: ^1.1||^2.0
- phpstan/phpstan-phpunit: ^1.3||^2.0
README
This package can quickly send alerts to Zoho Cliq. You can use this to notify yourself of any noteworthy events happening in your app.
use MarJose123\ZohoCliqAlert\Facades\ZohoCliqAlert; ZohoCliqAlert::channel('marketing')->message("You have a new subscriber to the {$newsletter->name} newsletter!");
Under the hood, a job is used to communicate with Zoho Cliq. This prevents your app from failing in case Zoho Cliq is down.
Installation
You can install the package via composer:
composer require marjose123/laravel-zoho-cliq-alert
You can publish the config file with:
php artisan vendor:publish --tag="laravel-zoho-cliq-alert-config"
This is the contents of the published config file:
return [ /* |-------------------------------------------------------------------------- | OAuth Credentials |-------------------------------------------------------------------------- | | These are OAuth credentials required for authentication with Zoho Cliq API. | You can obtain these credentials from your Zoho Cliq Developer Console: | https://api-console.zoho.com/ | */ 'client_id' => env('ZOHO_CLIENT_ID', ''), 'client_secret' => env('ZOHO_CLIENT_SECRET', ''), ];
Usage
Basic sending of message without using message card feature of Zoho Cliq.
use MarJose123\ZohoCliqAlert\Facades\ZohoCliqAlert; use \MarJose123\ZohoCliqAlert\ZohoDataCenter; ZohoCliqAlert::channel('marketing') ->asBot('MarketingWebsite') ->dataCenter(ZohoDataCenter::US) ->queue('default') ->message("You have a new subscriber to the {$newsletter->name} newsletter!") ->send();
You want to use modern card message. You can check Zoho Cliq Message Card for more details.
use MarJose123\ZohoCliqAlert\Facades\ZohoCliqAlert; use \MarJose123\ZohoCliqAlert\ZohoDataCenter; ZohoCliqAlert::channel('marketing') ->asBot('MarketingWebsite') ->dataCenter(ZohoDataCenter::US) ->queue('default') ->message("You have a new subscriber to the {$newsletter->name} newsletter!",[ 'card' => [ "title" => "ANNOUNCEMENT", "theme" => "modern-inline", "thumbnail" => "https://www.zoho.com/cliq/help/restapi/images/announce_icon.png" ], 'buttons' => [ [ "label" => "View", "type" => "+", "action" => [ "type" => "invoke.function", "data" => [ "name" => "internlist" ] ] ] ] ])->send();
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.