fd6130 / exabytes-sms-bundle
此捆绑包提供使用exabytes马来西亚API的短信服务。
v1.0.1
2022-05-25 09:23 UTC
Requires
- php: >=7.2.5
- symfony/http-client: ^4.4|^5.0|^6.0
- symfony/yaml: ^4.4|^5.0|^6.0
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); //... }