欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

PHP實(shí)現(xiàn)賽郵SUBMAIL簡(jiǎn)單易用短信通知實(shí)例

 更新時(shí)間:2023年10月15日 09:41:00   作者:huaweichenai  
這篇文章主要介紹了使用PHP實(shí)現(xiàn)賽郵SUBMAIL的簡(jiǎn)單易用短信通知實(shí)例,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪

實(shí)現(xiàn)短信通知實(shí)例

接口文檔地址:https://www.mysubmail.com/documents

$url = 'https://api-v4.mysubmail.com/sms/xsend';//接口地址
$appId = 'XXX';//APPID
$appkey = 'XXX';//APPKEY
$phone = 'XXX';//發(fā)送手機(jī)號(hào)
$project = 'XXX';//模板ID
$data = [
    'appid' => $appId,
    'to' => $phone,
    'timestamp' => time(),
    'sign_type' => 'md5',
    'sign_version' => 2,
    'project' => $project
];
ksort($data);
$signature = $appId . $appkey . http_build_query($data) . $appId . $appkey;
$data['signature'] = md5($signature);//數(shù)字簽名
$vars = [
    'code' => 'XXX',
];
$data['vars'] = json_encode($vars);//文本變量
$client = new Client();
$response = $client->createRequest()
    ->setMethod('POST')
    ->setUrl($url)
    ->setData($data)
    ->setHeaders([
        'Content-Type'=>'application/json',
    ])
    ->setFormat(Client::FORMAT_JSON) //提交的數(shù)據(jù)的格式
    ->send();

如上可以實(shí)現(xiàn)給指定手機(jī)號(hào)發(fā)送指定模板的通知內(nèi)容,其他方式可參照文檔實(shí)現(xiàn)

更多關(guān)于PHP賽郵SUBMAIL短信通知的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!

相關(guān)文章

最新評(píng)論