symfony/all-my-sms-notifier

Symfony AllMySms Notifier 桥接器

安装量: 17 318

依赖者: 1

建议者: 0

安全性: 0

星级: 3

关注者: 4

分支: 3

类型:symfony-notifier-bridge


README

为 Symfony Notifier 提供 AllMySms 集成。

DSN 示例

ALLMYSMS_DSN=allmysms://LOGIN:APIKEY@default?from=FROM

其中

  • LOGIN 是您的用户 ID
  • APIKEY 是您的 AllMySms API 密钥
  • FROM 是您的发送者(可选,默认:36180)

向消息添加选项

使用 AllMySms 消息,您可以使用 AllMySmsOptions 类来添加 消息选项

use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\AllMySms\AllMySmsOptions;

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

$options = (new AllMySmsOptions())
    ->alerting(1)
    ->campaignName('API')
    ->cliMsgId('test_cli_msg_id')
    ->date('2023-05-23 23:47:25')
    ->simulate(1)
    ->uniqueIdentifier('unique_identifier')
    ->verbose(1)
    // ...
    ;

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

$texter->send($sms);

资源