<?php
defined('InShopNC') or exit('Access Invalid!');
require_once(dirname(__FILE__) . DS . 'YunpianAutoload.php');

/**
* 模板接口发短信
* tpl_id 为模板id
* tpl_value 为模板值
* mobile 为接收短信的手机号
*/
function tpl_send_sms($tpl_id, $tpl_value, $mobile){
	$smsOperator = new SmsOperator();
	$data['mobile'] = $mobile;
    $data['tpl_id'] = $tpl_id;
	$data['tpl_value'] = urlencode("#code#") . "=" . urlencode($tpl_value) ;

	return $smsOperator->tpl_send($data);
}

/**
* 普通接口发短信
* content 为短信内容
* mobile 为接收短信的手机号
*/
function send_sms($content, $mobile){
	$smsOperator = new SmsOperator();
	$data['mobile'] = $mobile;
	$data['text'] = $content;

	return $smsOperator->single_send($data);
}
?>