Skip to content

cdcchen/yii2-alidayu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yii2-alidayu

配置组件

'alidayu' => [
    'appKey' => 'xxx',
    'appSecret' => 'yyy',
],

发送短信

/* @var \cdcchen\yii\alidayu\Client $client */
$client = Yii::$app->get('alidayu');
$response = $client->sendSms('手机号', '短信签名', '短信模板代码', '模板参数', '回传参数');
if ($response->isOK()) {
    // success data
    $data = $result->getData();
}
else {
    // error data
    $data = $result->getData();
}

手机号码 如果为多个,使用数组方式;
模板参数 具体根据模板要求;
回传参数 为可选参数,具体根据业务需求;

查询短信日志

/* @var \cdcchen\yii\alidayu\Client $client */
$client = Yii::$app->get('alidayu');
$response = $client->querySms('186xxxxxxxx', '日期', '当前页码', '每页条数', '流水号');
if ($response->isOK()) {
    // success data
    $data = $result->getData();
}
else {
    // error data
    $data = $result->getData();
}

日期 格式:20160607;
当前页码 从·q1开始;
每页条数 默认20

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages