symfony/gatewayapi-notifier

此包已被弃用且不再维护。作者建议使用symfony/gateway-api-notifier包。

Symfony GatewayApi Notifier Bridge

安装数量: 6,412

依赖者: 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](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);

资源