fd6130/exabytes-sms-bundle

此捆绑包提供使用exabytes马来西亚API的短信服务。

安装: 333

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:symfony-bundle

v1.0.1 2022-05-25 09:23 UTC

This package is auto-updated.

Last update: 2024-09-25 14:13:19 UTC


README

使用exabytes马来西亚API发送短信。有关API的更多详细信息,请阅读文档

要求

  • PHP 7.2+
  • Symfony 4.4+ 和 5+

安装

composer require fd6130/exabytes-sms-bundle

如果您使用flex,它将自动将此捆绑包添加到bundles.php

配置

更新您的.env文件以包括以下两个变量

# .env
EXABYTES_USERNAME=
EXABYTES_PASSWORD=

然后创建配置文件/config/fd_exabytes.yaml并放置以下内容

fd_exabytes:
    username: '%env(EXABYTES_USERNAME)%'
    password: '%env(EXABYTES_PASSWORD)%'

注入ExabytesInterface并开始发送短信

private $exabytes;

public function __construct(ExabytesInterface $exabytes)
{
    $this->exabytes = $exabytes;
}

public function sendSMS()
{
    $this->exabytes->send('mobile number', 'message', ExabytesInterface::ASCII);

    //...
}