实现python短信通知实例
接口文档地址:https://www.mysuhttp://www.devze.combmail.com/documents
$url = 'https://api-v4.mysubmail.com/sms/xsend';//接口地址 $appId = 'XXX';//APPID $appkey = 'XXX';//APPKEY $phone = 'XXX';//发送手机号 $project = 'XXX';//模板ID $data = [ 'appid' => $appId, 'to' => $phone, 'timestamp' => time(), 'sign_type' => 'md5', 'signpython_version' => 2, 'project' => $project ]; ksort($data);www.devze.com $signature = $appId . $appkey . http_build_query($data) . $appId . $appkey; $data['signature'] = md5($signature);//数字签名 $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', ]) -http://www.devze.com>setFormat(Client::FORMAT_JSON) //提交的数据的格式 ->send();
如上可以实现给指定手机号发送指定模板的通知内容,其他方式可参照文档实现
更多关于php赛邮SUBMAIL短信通知的资料请关注编程客栈(www.devze.com)其它相关文章!
精彩评论