symfony / termii-notifier
Symfony Termii Notifier 桥接器
v7.1.1
2024-05-31 14:57 UTC
Requires
- php: >=8.2
- symfony/http-client: ^6.4|^7.0
- symfony/notifier: ^6.4|^7.0
Requires (Dev)
- symfony/event-dispatcher: ^6.4|^7.0
This package is auto-updated.
Last update: 2024-08-25 06:43:38 UTC
README
为 Symfony Notifier 提供 Termii 集成。
DSN 示例
TERMII_DSN=termii://API_KEY@default?from=FROM&channel=CHANNEL
where
API_KEY
是您的 Termii API 密钥FROM
是您的发送者CHANNEL
是您的渠道(通用、免打扰、WhatsApp)
向消息添加选项
使用 Termii 消息,您可以使用 TermiiOptions
类添加 消息选项。
use Symfony\Component\Notifier\Message\SmsMessage; use Symfony\Component\Notifier\Bridge\Termii\TermiiOptions; $sms = new SmsMessage('+1411111111', 'My message'); $options = (new TermiiOptions()) ->type('test_type') ->channel('test_channel') ->media('test_media_url', 'test_media_caption') // ... ; // Add the custom options to the sms message and send the message $sms->options($options); $texter->send($sms);