symfony/gateway-api-notifier

Symfony GatewayApi Notifier 桥接器

安装数: 12,635

依赖项: 1

建议者: 0

安全性: 0

星标: 4

关注者: 4

分支: 3

类型:symfony-notifier-bridge


README

为 Symfony Notifier 提供 GatewayApi 集成。

DSN 示例

GATEWAYAPI_DSN=gatewayapi://TOKEN@default?from=FROM

其中

  • TOKEN 是 API 令牌 (OAuth)
  • FROM 是发件人名称

查看您的账户信息:https://gatewayapi.com

向消息添加选项

使用 GatewayApi 消息,您可以使用 GatewayApiOptions 类来添加 消息选项

use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\Bridge\GatewayApi\GatewayApiOptions;

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

$options = (new GatewayApiOptions())
    ->class('standard')
    ->callbackUrl('https://my-callback-url')
    ->userRef('user_ref')
    // ...
    ;

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

$texter->send($sms);

资源