symfony/contact-everyone-notifier

Symfony Contact Everyone Notifier 桥接器

安装: 787

依赖: 0

建议: 0

安全: 0

星级: 3

关注者: 4

分支: 0

类型:symfony-notifier-bridge

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

README

为 Symfony Notifier 提供联系所有人集成。

DSN 示例

CONTACT_EVERYONE_DSN=contact-everyone://TOKEN@default?&diffusionname=DIFFUSION_NAME&category=CATEGORY

其中

  • TOKEN 是您的 Contact Everyone API 令牌
  • DIFFUSION_NAME(可选)允许您定义将在事件日志中显示的扩散标签。
  • CATEGORY(可选)允许您定义将在事件日志中显示的类别标签。

此桥接器使用 Contact Everyone API 的轻量版。

请在https://contact-everyone.orange-business.com/#/login查看您的账户信息

向消息添加选项

使用 Contact everyone 消息,您可以使用 ContactEveryoneOptions 类来添加消息选项。

use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\ContactEveryone\ContactEveryoneOptions;

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

$options = (new ContactEveryoneOptions())
    ->diffusionName('My label')
    ->category('my-category')
    // ...
    ;

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

$texter->send($sms);

资源