定制 marjose123/laravel-zoho-cliq-alert 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

marjose123/laravel-zoho-cliq-alert

最新稳定版本:1.0.0

Composer 安装命令:

composer require marjose123/laravel-zoho-cliq-alert

包简介

Quickly send a message to Zoho Cliq Channels.

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-03-07