symfony/primotexto-notifier

Symfony Primotexto Notifier 桥接器

安装: 0

依赖者: 0

建议者: 0

安全: 0

星标: 1

关注者: 2

分支: 0

类型:symfony-notifier-bridge

7.2.x-dev 2024-09-20 10:59 UTC

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);

资源