dankal/dk-alidayu

阿里大于 - 短信sdk

This package's canonical repository appears to be gone and the package has been frozen as a result.

1.0.3 2017-07-11 09:37 UTC

This package is not auto-updated.

Last update: 2021-06-12 01:29:27 UTC


README

阿里大于短信 sdk

NOTICE

迁移至阿里云后的短信服务不适用该 sdk ,请使用 dankal/dk-ali-sms

Install

Via Composer

$ composer require dankal/dk-alidayu

Usage

use Dankal\DkAlidayu\AlidayuSms;
$sendSms = new AlidayuSms($appKey, $appSecret);
$sendSms->setRecNum("13100000000");
$sendSms->setSignName("注册验证");
$sendSms->setTemplateCode("SMS_7654321");
$sendSms->setSmsParam(["code" => "123321", "content" => "hello"]);
// or use config
//$sendSms->config("13100000000", "注册验证", "SMS_7654321", ["code" => '123321', "content" => "hello"]);
$result = $sendSms->send();
if (!$result) {
    $sendSms->getErrorCode();
    $sendSms->getErrorMessage();
}

Credits

License

The MIT License (MIT).