symfony / mobyt-notifier

Symfony Mobyt Notifier 桥接器

安装数: 7,991

依赖者: 2

建议者: 0

安全性: 0

星标: 3

关注者: 5

分支: 2

类型:symfony-notifier-bridge


README

为 Symfony Notifier 提供 Mobyt 集成。

DSN 示例

MOBYT_DSN=mobyt://USER_KEY:ACCESS_TOKEN@default?from=FROM&type_quality=TYPE_QUALITY

where

  • USER_KEY 是你的 Mobyt 用户密钥
  • ACCESS_TOKEN 是你的 Mobyt 访问令牌
  • FROM 是发送者
  • TYPE_QUALITY 是消息质量:N 为高,L 为中,LL 为低(默认:L

向消息添加选项

使用 Mobyt 消息,你可以使用 MobytOptions 类来添加 消息选项

use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\Mobyt\MobytOptions;

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

$options = (new MobytOptions())
    ->messageType(MobytOptions::MESSAGE_TYPE_QUALITY_HIGH)
    // ...
    ;

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

$texter->send($sms);

资源