2017 © Pedro Peláez
 

library yii2-dysms

Aliyun SMS SDK for Yii2

image

saviorlv/yii2-dysms

Aliyun SMS SDK for Yii2

  • Friday, October 27, 2017
  • by Alexcck
  • Repository
  • 0 Watchers
  • 7 Stars
  • 268 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 6 Versions
  • 43 % Grown

The README.md

aliyun-dysms

安装

composer require "saviorlv/yii2-dysms:dev-master"

or添加下列代码在composer.json文件中并执行composer update 操作, (*1)

{
    "require": {
       "saviorlv/yii2-dysms":"dev-master"
    }
}

设置方法

全局使用

在config/main.php配置文件中定义component配置信息, (*2)

'components' => [
  .....
  'aliyun' => [
      'class' => 'saviorlv\aliyun\Sms',
      'accessKeyId' => '123455',
      'accessKeySecret' => '122345666'
    ],
  ....
]

代码中调用(调用短信发送接口示例), (*3)

// 单条发送
$response = Yii::$app->aliyun->sendSms(
            "孙坤峰", // 短信签名
            "SMS_76350132", // 短信模板编号
            "136*****134", // 短信接收者
            Array(  // 短信模板中字段的值
                "code"=>"12345",
                "product"=>"dsd"
            ),
            "123"
        );
        print_r($response);

//批量发送

$response = Yii::$app->aliyun->sendBatchSms(
            array("孙坤峰","孙坤峰"), // 短信签名
            "SMS_76350132", // 短信模板编号
            array("136*****134","180*****459"), // 短信接收者
            array(array(  // 短信模板中字段的值
                "code"=>"12345",
                "product"=>"dsd"
            ),array(  // 短信模板中字段的值
                "code"=>"123456",
                "product"=>"dsd"
            )),
            "123"
        );
//批量发送 签名、手机号、模板字段 数组长度必须相等

如上所示 180*******259收到的短信 签名是"孙坤峰" 内容为  123456

The Versions

27/10 2017

dev-master

9999999-dev https://github.com/saviorlv/yii2-dysms

Aliyun SMS SDK for Yii2

  Sources   Download

Apache-2.0

The Requires

  • php >=5.5.0

 

yii2 sms sdk aliyun

26/10 2017

1.1.3

1.1.3.0 https://www.aliyun.com/product/sms

Aliyun SMS SDK for PHP

  Sources   Download

Apache-2.0

The Requires

  • php >=5.5.0

 

sms sdk aliyun

26/10 2017

1.1.2

1.1.2.0 https://www.aliyun.com/product/sms

Aliyun SMS SDK for PHP

  Sources   Download

Apache-2.0

The Requires

  • php >=5.5.0

 

sms sdk aliyun

26/10 2017

1.1.1

1.1.1.0 https://www.aliyun.com/product/sms

Aliyun SMS SDK for PHP

  Sources   Download

Apache-2.0

The Requires

  • php >=5.5.0

 

sms sdk aliyun

25/10 2017

1.1.0

1.1.0.0 https://www.aliyun.com/product/sms

Aliyun SMS SDK for PHP

  Sources   Download

Apache-2.0

The Requires

  • php >=5.5.0

 

sms sdk aliyun

25/10 2017

1.0.0

1.0.0.0 https://www.aliyun.com/product/sms

Aliyun SMS SDK for PHP

  Sources   Download

Apache-2.0

The Requires

  • php >=5.5.0

 

sms sdk aliyun