gzdsx / sms-sdk
PHP SMS SDK
1.1.0
2023-03-29 10:22 UTC
Requires
- php: ^7.0
- ext-json: *
- alibabacloud/client: ^1.5
- tencentcloud/tencentcloud-sdk-php: ^3.0
This package is auto-updated.
Last update: 2025-03-08 08:32:51 UTC
README
开始
composer require gzdsx/sms-sdk
注册APP
在应用入口处注册,如Laravel的AppSericeProvider的boot处
1.阿里云注册
SmsSdk::registerAliyun('your accessKeyId','accessSecret','默认签名','默认模版');
2.腾讯云注册
SmsSdk::registerTencentCloud('your secretId','your secretKey','默认SmsSdkAppId','默认签名','默认模版');
使用阿里云发送
SmsSdk::aliyun() ->setPhoneNumbers('13800000000') ->setTemplateParam(['code'=>'123456']) ->send();
使用腾讯云发送
SmsSdk::tencentCloud() ->setPhoneNumbers('13800000000') ->setTemplateParam(['code'=>'123456']) ->send();