denis-korolev/mattermost-webhook 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

denis-korolev/mattermost-webhook

Composer 安装命令:

composer require denis-korolev/mattermost-webhook

包简介

Library to send messages with Mattermost Webhook

README 文档

README

Test status on master

Client to work with Matermost webhook

This library will help you send messages to Mattermost by Webhook.

Installation / Usage

Install the latest version via composer:

composer require denis-korolev/mattermost-webhook

Here is an example of usage.

        use App\Mattermost\Attachment;
        use App\Mattermost\Message;
        use App\Mattermost\WebhookClient;
        use App\Mattermost\WebhookParams;
        use GuzzleHttp\Client;
        
        // Any PSR7 Client
        $psr7Client = new Client();
        $webhookParams = new WebhookParams('http://matermost/hooks/2222222222', 'town-square', 'tester');
        $client = new WebhookClient($psr7Client, $webhookParams);

        $attachment = (new Attachment())->setFallback('This is the fallback test for the attachment.')
            ->setSuccessColor()
            ->setPretext('This is optional pretext that shows above the attachment.')
            ->setText('This is the text. **Finaly!** :let_me_in: ');
            
        // you can add array of attachments
        $message = new Message('Testing Mattermost client', '', [$attachment]);

        $client->send($message);
        // or
        $client->batchSend([$message]);

If you need to send huge text, more than 4000 symbols, you can use

    $messages = MessageHelper::createMessagesWithTextAttachments('huge text, longer 4000 symbols');
    $client->batchSend(...$messages);

It will create Message[], which you can send. It will break text by pages and qoute it by ``` So you just send it and it will print at chat one after another.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-18

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固