mikaelkael/ntfy-notifier
最新稳定版本:v2.1.0
Composer 安装命令:
composer require mikaelkael/ntfy-notifier
包简介
Symfony Ntfy Notifier Bridge
关键字:
README 文档
README
Provides Ntfy integration for Symfony Notifier. The component should be introduced in Symfony 6.4 with this PR #50131. This bundle provides same functionalities for Symfony 5.4.x to 6.3.x.
DSN example
# .env NTFY_DSN=ntfy://[USER:PASSWORD]@default[:PORT]/TOPIC?[secureHttp=[on]]
where:
URLis the ntfy server which you are using- if
defaultis provided, this will default to the public ntfy server hosted on ntfy.sh.
- if
TOPICis the topic on this ntfy server.PORTis an optional specific port.USERandPASSWORDare username and password in case of access control supported by the server
In case of a non-secure server, you can disable https by setting secureHttp=off.
Enable texter
# config/packages/notifier.yaml framework: notifier: texter_transports: nfty: '%env(NTFY_DSN)%'
Send push message
// src/Controller/TestController.php namespace App\Controller; use Symfony\Component\Notifier\Message\SmsMessage; use Symfony\Component\Notifier\TexterInterface; use Symfony\Component\Routing\Annotation\Route; class TestController { /** * @Route("/test") */ public function test(TexterInterface $texter) { $pushMessage = new PushMessage( 'Title', 'Message content', new NtfyOptions(['tags' => ['warning'], 'priority' => 5]) ); $result = $texter->send($pushMessage); // ... } }
统计信息
- 总下载量: 146
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-07