2017 © Pedro Peláez
 

library aliyun-php-sdk-sms

This is a composer/packagist fot Aliyun-Sms OpenAPI

image

luyisuifeng/aliyun-php-sdk-sms

This is a composer/packagist fot Aliyun-Sms OpenAPI

  • Monday, November 7, 2016
  • by luyisuifeng
  • Repository
  • 2 Watchers
  • 5 Stars
  • 3,004 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 23 % Grown

The README.md

aliyun-php-sdk-sms

阿里云短信服务提供composer解决方案, (*1)

install

$ composer require luyisuifeng/aliyun-php-sdk-sms, (*2)

发布v1.0.1版本,修复exception命名空间问题,增加demo

demo

use Aliyun\Core\Profile\DefaultProfile;
use Aliyun\Core\DefaultAcsClient;
use Aliyun\Core\Exception\ClientException;
use Aliyun\Core\Exception\ServerException;
use Aliyun\Core\Regions\Endpoint;
use Aliyun\Core\Regions\EndpointProvider;
use Aliyun\Core\Regions\EndpointConfig;
use Aliyun\Core\Sms\Request\V20160927\SingleSendSmsRequest;
$iClientProfile = DefaultProfile::getProfile('cn-hangzhou', 'your accessKeyId', 'your accessSecret);
$client = new DefaultAcsClient($iClientProfile);
$config = new EndpointConfig();
$endpoint = new Endpoint('cn-hangzhou', $config->getRegionIds(), $config->getProductDomains());
$endpoints = array( $endpoint );
EndpointProvider::setEndpoints($endpoints);
$request = new SingleSendSmsRequest();
$request->setSignName('XXXX'); //签名名称
$request->setTemplateCode('SMS_123456'); //模板id
$request->setRecNum('138xxx');//目标手机号
$request->setParamString("{\"goodname\":\"商品名\",\"specinfo\":\"商品属性\"}");//模板变量,数字一定要转换为字符串
try {
$response = $client->getAcsResponse($request);
print_r($response);
}
catch (ClientException $e) {
print_r($e->getErrorCode());
print_r($e->getErrorMessage());
}
catch (ServerException $e) {
print_r($e->getErrorCode());
print_r($e->getErrorMessage());
}, (*3)

The Versions

07/11 2016

dev-master

9999999-dev https://github.com/luyisuifeng/aliyun-php-sdk-sms

This is a composer/packagist fot Aliyun-Sms OpenAPI

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by sifan

php sms sdk aliyun open-api aliyun-sms aliyun-php-sdk-sms

07/11 2016

v1.0.1

1.0.1.0 https://github.com/luyisuifeng/aliyun-php-sdk-sms

This is a composer/packagist fot Aliyun-Sms OpenAPI

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by sifan

php sms sdk aliyun open-api aliyun-sms aliyun-php-sdk-sms

28/10 2016

v1.0.0

1.0.0.0 https://github.com/luyisuifeng/aliyun-php-sdk-sms

This is a composer/packagist fot Aliyun-Sms OpenAPI

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

by sifan

php sms sdk aliyun open-api aliyun-sms aliyun-php-sdk-sms