Giter Club home page Giter Club logo

submail-sdk's Introduction

Submail-sdk

via Composer

composer require stefein/submail-sdk

laravel/lumen/thinkphp 5/ slim/yii 适用

<?php

use Stefein\Submail;

/*
*   @sign_type  为 md5 sha1 或者 normal 
*   @config   =   array('appid'=>xxxxx,'appkey'=>xxxxxxxxxxxx,'sign_type'=>'md5');
*   以上为基本参数
*   使用模板发送 则需要加入 控制台项目名称project,如:JCB6G2 
*/

$obj = new Submail($config);
通用接口

1.getLog

/*
*   @可选参数('message','internationalsms','voice','mms','mail')
*/

$res = $obj->getLog('message'); 

2.getCredits

/*
*   @可选参数('message','internationalsms','voice','mms','mail')
*/

$res = $obj->getCredits('message'); 

短信

messageSend

$obj->messageSend('130*********','【SUBMAIL】您的短信验证码:4438,请在10分钟内输入。');

messagexSend

$vars   =   array('code'=>rand(100,999));
$obj->messagexSend("130*********",$vars);

messageMultisend

$content    =   '【Submail】您好,@var(name),您的取货码为 @var(code)';
$data=[
    ['to'=>'130********','name'=>'****','code'=>rand(100,999)],
    ['to'=>'131********','name'=>'****','code'=>rand(100,999)]
];
$obj->messageMultisend($content,$data);

messageMultixsend

//$data=[
//    ['to'=>'130********','name'=>'master','code'=>rand(100,999)],
//    ['to'=>'131********','name'=>'John','code'=>rand(100,999)]
//];
//$res    =   $obj->messageMultixsend($data);

语音

voiceXsend

$vars   =   array('code'=>rand(100,999));
$obj->voiceXsend("131********",$vars);

voiceMultixsend

$data=[
    ['to'=>'131********','code'=>rand(100,999)],
    ['to'=>'130********','code'=>rand(100,999)]
];
$obj->voiceMultixsend($data);

voiceVerify

$obj->voiceVerify("130********",rand(1000,9999));

邮件

mailSend

$res    =   $obj->mailSend(
    array(
        'to'=>'[email protected]',
        'from'=>'[email protected]',
        'from_name'=>'调查',
        'reply'=>'[email protected]',
        'cc'=>'[email protected]',
        'bcc'=>'[email protected]',
        'text'=>'xxxx',
        'html'=>'xxxx',
        'subject'=>'xxxx',
        'tag'=>'xxxx',
        'vars'=>array('name'=>'xxx'),
        'links'=> array('mail'=>'xxxxx','account'=>'xxxxx'),
        'attachments'=>array('/Users/submail/submail-sdk/tests/a.png','/Users/submail/submail-sdk/tests/a.png')
    )
);

mailXsend

$res    =   $obj->mailXsend(
    array(
        'to'=>'[email protected],[email protected],',
        'from'=>'[email protected]',
        'from_name'=>'xxxx',
        'reply'=>'[email protected]',
        'cc'=>'[email protected]',
        'bcc'=>'[email protected]',
        'text'=>'xxxx',
        'html'=>'xxxx',
        'subject'=>'xxxx',
        'project'=>'xxxx',
        'tag'=>'xxxx',
        'vars'=>array('name'=>'xxx'),
        'links'=> array('mail'=>'xxxxx','account'=>'xxxxx')
        )
    )
);

国际短信

Changelog

LICENSE

submail-sdk's People

Contributors

5asp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.