2017 © Pedro Peláez
 

project component_sms

tp5. resource api

image

itboye/component_sms

tp5. resource api

  • Wednesday, July 11, 2018
  • by h136799711
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

component_sms

Latest Stable Version Total Downloads Monthly Downloads Daily Downloads License, (*1)

  1. 短信帮助

简介

  1. 对接了聚合单发、腾讯云国内、阿里云国内短信单发
<?php
/**
 * Created by PhpStorm.
 * User: itboye
 * Date: 2018/7/11
 * Time: 11:31
 */

require_once __DIR__."/../vendor/autoload.php";

use by\component\sms\juhe\SmsManage;

class TestSmsHelper
{
    public function testIndex()
    {
        $data = [
            'key' => '聚合的KEY',
            'mobile' => '112345678900',
            'tpl_id' => '62520',
            'tpl_value' =>urlencode('#code#=123456')
        ];
        $result = SmsManage::instance()->setData($data)->send();
        var_dump($result);
    }

    public function testQcloud()
    {
        $data = [
            //测试用
            'app_id' => '',
            'app_key' => '',
//            'sms_sign' =>'小鲤智能',
//            'template_id' => '31528',
//            'params'=>[
//                '测试',\by\component\string_extend\helper\StringHelper::randAlphabet(6),'其它'
//            ],
            'mobile' => [
                ['86', '18557515452']
            ],
            'msg' => '【小鲤智能】您正在进行[单发]操作,您的验证码是xxxx。44如非本人操作,请忽略本短信',
        ];
        $result = \by\component\sms\qcloud\QcloudSmsManage::instance()->setData($data)->send();
        var_dump($result);
    }

    public function testAliyun() {
        $data = [
            'phone'=>'18557515452',
            'sign' => '登录验证',
            'template' => 'SMS_8145826',
            'template_params' => '{"customer":"何必都"}',
            'access_key_id' => '',
            'access_key_secret' => 'fu9SHp9zMe37CNsjuBr4rn0Zsk1VWv',
            'region' => 'cn-beijing',
            'end_point_name' => 'cn-beijing',
            'api_uri' => 'dysmsapi.aliyuncs.com',
        ];

        $sms = new \by\component\sms\aliyun\AliyunSmsManage();
        $resp = $sms->setData($data)->send();
        var_dump($resp);
    }
}

$helper = new TestSmsHelper();
//$helper->testIndex();
//$helper->testQcloud();
$helper->testAliyun();

安装

composer require itboye/component_sms 1.0.*

The Versions

11/07 2018

dev-master

9999999-dev

tp5. resource api

  Sources   Download

MIT

The Requires

 

by hebidu

h136799711

11/07 2018

v1.0.0

1.0.0.0

tp5. resource api

  Sources   Download

MIT

The Requires

 

by hebidu

h136799711