testmonitor/teams-client
Composer 安装命令:
composer require testmonitor/teams-client
包简介
The TestMonitor Teams Client.
关键字:
README 文档
README
This package provides a very basic, convenient, and unified wrapper for sending messages to Microsoft Teams using an incoming webhook.
It's mostly a based on Sebastian Bretschneider's PHP Microsoft Teams Connector, but uses Guzzle instead of the PHP CURL extension. This package leverages Microsoft Teams Adaptive Cards, making it a great fit for Power Automate.
Table of Contents
Installation
To install the client you need to require the package using composer:
$ composer require testmonitor/teams-client
Use composer's autoload:
require __DIR__.'/../vendor/autoload.php';
You're all set up now!
Usage
Before you can post messages, you need to set up an incoming webhook in Teams:
- Launch the Microsoft Teams application.
- Select the Teams tab.
- Locate the channel where you want notifications delivered, then click the three dots (More options) next to it.
- Select Workflows from the dropdown menu.
- In the search bar, type "webhook".
- Choose the Post to a channel when a webhook request is received template.
- Enter a name for the workflow or use the default name.
- Click Next.
- Confirm the selected Team and Channel.
- Click Add workflow and your webhook URL will be provided.
Use the webhook URL to create a new client instance:
$teams = new \TestMonitor\Teams\Client('https://webhook.url/');
Examples
Post a simple message to Teams:
$card = new \TestMonitor\Teams\Resources\Card; $card->addElement( new \TestMonitor\Teams\Resources\Card\Elements\TextBlock('Simple heading') ); $teams->postMessage($card);
Adaptive cards allow way more comprehensive messages. Here's another example:
$card = new \TestMonitor\Teams\Resources\Card; $title = new \TestMonitor\Teams\Resources\Card\Elements\TextBlock('Simple heading'); $facts = new \TestMonitor\Teams\Resources\Card\Elements\FactSet( new \TestMonitor\Teams\Resources\Card\Elements\Fact('Status', 'Completed'), new \TestMonitor\Teams\Resources\Card\Elements\Fact('Category', 'Feature request'), ); $action = new \TestMonitor\Teams\Resources\Card\Actions\OpenUrl('https://www.testmonitor.com/'); $card->addElement($title) ->addElement($facts) ->addAction($action); $teams->postMessage($card);
For more information on composing these messages, head over to PHP Microsoft Teams Connector for more examples or refer to Microsoft's documentation on Adaptive Cards.
Tests
The package contains integration tests. You can run them using PHPUnit.
$ vendor/bin/phpunit
Changelog
Refer to CHANGELOG for more information.
Contributing
Refer to CONTRIBUTING for contributing details.
Credits
- Thijs Kok - Lead developer - ThijsKok
- Stephan Grootveld - Developer - Stefanius
- Frank Keulen - Developer - FrankIsGek
- Muriel Nooder - Developer - ThaNoodle
License
The MIT License (MIT). Refer to the License for more information.
testmonitor/teams-client 适用场景与选型建议
testmonitor/teams-client 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.37k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2021 年 09 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「client」 「Teams」 「testmonitor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 testmonitor/teams-client 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 testmonitor/teams-client 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 testmonitor/teams-client 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
User to Team associations for the Laravel Framework
A simple PHP package for sending messages to Microsoft Teams
Tracks the user responsible for creating, modifying, or deleting an Eloquent model
The TestMonitor Mantis Client.
The TestMonitor TOPdesk client.
The TestMonitor Asana Client.
统计信息
- 总下载量: 2.37k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 21
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-21