错误:使用smsindiahub发送的短信中的024

时间:2017-03-15 06:34:47

标签: php codeigniter sms-gateway

我正在使用smsindiahub发送短信,但不发送短信,

 function send_user_pickup_sms($mobile_number = '', $verification_code = '', $smsemailarray=array(),$date="",$time="") {
    if ($mobile_number != '' && $verification_code != '') {
        //$customer_name    = $userDetails['FirstName'].' '.$userDetails['LastName'];
        $message = 'projectname Order ID '.$verification_code.' picked up on '.$date.' at '.$time.': ';
        foreach($smsemailarray as $item){
           $message .= $item["Qty"].$item["name"].' ';
        }

        $message = urlencode($message);

        //Send Registration code to user via sms
        $apiURL = "http://login.smsindiahub.in/vendorsms/pushsms.aspx?user=" . SMSHUB_USERNAME . "&password=" . SMSHUB_PASSWORD . "&msisdn=" . $mobile_number . "&sid=" . SMSHUB_SENDERID . "&msg=" . $message . "&fl=" . SMSHUB_FLAG . "&gwid=" . SMSHUB_GWID;

        //  Initiate curl
        $ch = curl_init();
        // Set The Response Format to Json
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
        // Disable SSL verification
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        // Will return the response, if false it print the response
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        // Set the url
        curl_setopt($ch, CURLOPT_URL, $apiURL);
        // Execute
        $result = curl_exec($ch);
       echo"<pre>";print_R($result);die;
        // Closing
        curl_close($ch);

        return $result;
    }
    return false;
}

打印结果如下:

{"ErrorCode":"24","ErrorMessage":"Invalid template or template mismatchInvalid template or template mismatch","JobId":null,"MessageData":null}

我不明白哪里有错,有人可以帮我解决吗?

1 个答案:

答案 0 :(得分:2)

请在 smsindiahub 面板中查看。请检查模板的状态。确保您的模板已获批准且未挂起。

由于