No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
wilddog
.gitignore
README.md
composer.json

README.md

wilddog-sms

Wilddog SMS SDK for PHP

安装

composer require wilddog/sms

初始化

require_once PATH_TO_YOUR_PROJECT_ROOT_DIR . '/vendor/autoload.php';

use wilddog\sms\Settings;
use wilddog\sms\Sms;

$settings = new Settings('<YOUR_APP_ID>', '<YOUR_SMS_KEY>');
$sms = new Sms($settings);

发送验证码短信

$sms.sendCode($mobile, $templateId, Settings $settings, $var = array())

$response = $sms->sendCode('<PHONE_NUMBER>', '<YOUR_TEMPLATE_ID>', $settings);
echo $response->__toString();

$response = $sms->sendCode('<PHONE_NUMBER>', '<YOUR_TEMPLATE_ID>', $settings, array('Var1', 'Var2'));
echo $response->__toString();

校验验证码

sms.checkCode($mobile, $code)

$response = $sms->checkCode('<PHONE_NUMBER>', '<CODE>');
echo $response->__toString();

发送通知短信

sms.sendNotify($mobiles = array(), $templateId, $params = array())

$response = $sms->sendNotify(array('<PHONE_NUMBER>'), '<YOUR_TEMPLATE_ID>', array('Var1', 'Var2'));
echo $response->__toString();

查询发送状态

sms.checkStatus($rrid)

$response = $sms->checkStatus('<RRID>');
echo $response->__toString();

查询账户余额

sms.getBalance()

$response = $sms->getBalance();
echo $response->__toString();

Contributors

zishang520