通过api发布回复而不发送电子邮件

时间:2019-05-28 04:06:06

标签: osticket

您好,我使用osticket进行票务系统,我使用API​​创建票证,当我在代理面板中登录并更新票证状态并选择罐头响应电子邮件时,但是当我尝试使用API​​电子邮件更新satatus时,状态正在更改,响应已保存,但电子邮件没有发送,这是我的帖子回复方法

$data = array(
            'ticketNumber' =>34343,     
            'msgId' => 'true',   
            'a'      =>  'reply',  
            'emailreply'     => '1', 
            'emailcollab'   =>  1,
            'cannedResp'    =>  3,
            'draft_id'  =>      '',
            'response'  =>      'Hi,The Testing has been Completed of your Reported Task Ticket From Live',
            'signature'   =>  'none',  
            'reply_status_id'   => 3,  
            'staffUserName'        => 'fahim', 
            'ip_address'   =>      192.185.57.132, 
            'cannedattachments' => ''
        );

        function_exists('curl_version') or die('CURL support required');
        function_exists('json_encode') or die('JSON support required');
        set_time_limit(300);
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $config['url']);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
        curl_setopt($ch, CURLOPT_USERAGENT, 'osTicket API Client v1.8');
        curl_setopt($ch, CURLOPT_HEADER, FALSE);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Expect:', 'X-API-Key: '.$config['key']));
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
        $result_ost=curl_exec($ch);
        print_r($result_ost);

        if(curl_errno($ch)){
            echo 'Request Error:' . curl_error($ch);
        }


Response from post reply is 
{"status_code":"0","status_msg":"reply posted successfully"}
status updated success full response also showing but email is not going via API post reply

0 个答案:

没有答案