symfony / primotexto-notifier
Symfony Primotexto Notifier 桥接器
7.2.x-dev
2024-09-20 10:59 UTC
Requires
- php: >=8.2
- symfony/http-client: ^6.4|^7.0
- symfony/notifier: ^7.2
This package is auto-updated.
Last update: 2024-09-20 13:34:20 UTC
README
为 Symfony Notifier 提供 Primotexto 集成。
DSN 示例
PRIMOTEXTO_DSN=primotexto://APIKEY@default?from=FROM
where
APIKEY
是您的 Primotexto API 密钥FROM
是您的发送者名称
向消息添加选项
使用 Primotexto 消息,您可以使用 PrimotextoOptions
类添加 消息选项。
use Symfony\Component\Notifier\Message\SmsMessage; use Symfony\Component\Notifier\Bridge\Primotexto\PrimotextoOptions; $sms = new SmsMessage('+1411111111', 'My message'); $options = (new PrimotextoOptions()) ->campaignName('Code de confirmation') ->category('codeConfirmation') ->campaignDate(1398177000000) // ... ; // Add the custom options to the sms message and send the message $sms->options($options); $texter->send($sms);