Exemplo n.º 1
0
 /**
  * 删除模板
  * @param string $tpl_id 模板ID
  * @return mixed
  */
 public function tpl_del($tpl_id)
 {
     if (isset($tpl_id)) {
         $tplOperator = new \TplOperator();
         $result = $tplOperator->del(['tpl_id' => $tpl_id]);
         if ($result && is_object($result)) {
             $this->state = isset($result->responseData['code']) ? $result->responseData['code'] : (isset($result->success) && $result->success ? 0 : '');
             $this->message = isset($result->responseData['msg']) ? $result->responseData['msg'] : '删除模板出现未知错误';
         }
     }
     return $this->state === 0;
 }
Exemplo n.º 2
0
//$data['mobile'] = '13400000000,13400000001,1,13400000003';
//$data['tpl_id'] = "1";
//$data['tpl_value'] =
//    urlencode("#code#") . "="
//    . urlencode("1234") . "&"
//    . urlencode("#company#") . "="
//    . urlencode("云片网");
//$result = $smsOperator->tpl_send($data);
//print_r($result);
// 流量
$flowOperator = new FlowOperator();
$result = $flowOperator->get_package();
print_r($result);
$result = $flowOperator->recharge(array("sn" => "1008601", "mobile" => "18700000000"));
print_r($result);
// 语音
$voiceOperator = new VoiceOperator();
$result = $voiceOperator->send(array("mobile" => "18700000000", "code" => "1234"));
print_r($result);
// 获取用户信息
$userOperator = new UserOperator();
$result = $userOperator->get();
print_r($result);
// 模板
$tplOperator = new TplOperator();
$result = $tplOperator->get_default(array("tpl_id" => '2'));
print_r($result);
$result = $tplOperator->get();
print_r($result);
$result = $tplOperator->add(array("tpl_content" => "【bb】大倪#asdf#"));
print_r($result);
Exemplo n.º 3
0
//$data['mobile'] = '13400000000,13400000001,1,13400000003';
//$data['tpl_id'] = "1";
//$data['tpl_value'] =
//    urlencode("#code#") . "="
//    . urlencode("1234") . "&"
//    . urlencode("#company#") . "="
//    . urlencode("云片网");
//$result = $smsOperator->tpl_batch_send($data);
//print_r($result);
// 流量
$flowOperator = new FlowOperator();
$result = $flowOperator->get_package();
print_r($result);
$result = $flowOperator->recharge(array("sn" => "1008601", "mobile" => "18700000000"));
print_r($result);
// 语音
$voiceOperator = new VoiceOperator();
$result = $voiceOperator->send(array("mobile" => "18700000000", "code" => "1234"));
print_r($result);
// 获取用户信息
$userOperator = new UserOperator();
$result = $userOperator->get();
print_r($result);
// 模板
$tplOperator = new TplOperator();
$result = $tplOperator->get_default(array("tpl_id" => '2'));
print_r($result);
$result = $tplOperator->get();
print_r($result);
$result = $tplOperator->add(array("tpl_content" => "【云片网】尊敬的用户,您的验证码#code#"));
print_r($result);