roobieboobieee / laravel-notifications-microsoft-teams
此包已 弃用 并不再维护。未建议替代包。
1.2.0
2021-02-17 14:02 UTC
Requires
- php: >=7.2
- illuminate/notifications: >=5.5 <9.0
- illuminate/support: >=5.5 <9.0
Requires (Dev)
- mockery/mockery: ^1.0
- phpunit/phpunit: ^7.0 || ^8.0
This package is auto-updated.
Last update: 2024-02-06 19:56:12 UTC
README
此包可以轻松使用 Laravel 5.5+ 和 6.0 通过 Teams 发送通知
内容
安装
您可以通过 composer 安装此包
composer require roobieboobieee/laravel-notifications-microsoft-teams
接下来,您必须加载服务提供者
// config/app.php
'providers' => [
// ...
RoobieBoobieee\Teams\TeamsServiceProvider::class,
],
在您希望通过 Teams 通知的每个模型中,您必须添加 routeNotificationForTeams 方法
// config/services.php
// ...
public function routeNotificationForTeams()
{
return $this->webhook;
}
用法
在您的 Notification
中实现一个 toTeams
方法,该方法返回一个 Message
对象。
public function toTeams($notifiable)
{
$message = new Message('Example message');
$section = new Section();
$section->activityTitle('Example title');
$message->add($section);
return $message;
}
待办事项
- 实现
potentialAction
变更日志
有关最近更改的更多信息,请参阅 CHANGELOG
安全
如果您发现任何与安全相关的问题,请通过 robvankeilegom@gmail.com 发送电子邮件,而不是使用问题跟踪器。
贡献
有关详细信息,请参阅 CONTRIBUTING
鸣谢
许可证
MIT 许可证 (MIT)。有关更多信息,请参阅 许可证文件