symfony/smsmode-notifier

Symfony Smsmode Notifier 桥接器

安装次数: 5,390

依赖项: 0

建议者: 0

安全性: 0

星级: 3

关注者: 4

分支: 0

类型:symfony-notifier-bridge

v7.1.1 2024-05-31 14:57 UTC

README

为 Symfony Notifier 提供 Smsmode 集成。

DSN 示例

SMSMODE_DSN=smsmode://API_KEY@default?from=FROM

其中

  • API_KEY 是您的 Smsmode API 密钥
  • FROM 是您的发送者 ID

向消息添加选项

使用 Smsmode 消息,您可以使用 SmsmodeOptions 类添加 消息选项

use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\Smsmode\SmsmodeOptions;

$sms = new SmsMessage('+1411111111', 'My message');

$options = (new SmsmodeOptions())
    ->refClient('ref_client')
    ->sentDate('sent_date')
    // ...
    ;

// Add the custom options to the sms message and send the message
$sms->options($options);

$texter->send($sms);

资源