修改有件发送接口

mobile-first
cyc 5 years ago
parent 9fa6fe03a2
commit 16bf3af463

@ -143,14 +143,37 @@ class api extends CI_Controller{
}
//发邮件给外联
function send_mail_to_wl($subject,$body,$coli_id){
function send_mail_to_wl($subject=null,$body=null,$coli_id=null){
header('Access-Control-Allow-Origin:*');
header('Access-Control-Allow-Methods:POST, GET');
header('Access-Control-Max-Age:0');
header('Access-Control-Allow-Headers:x-requested-with, Content-Type');
header('Access-Control-Allow-Credentials:true');
$fromName = "cyc";
$fromEmail = "cyc@hainatravel.com";
if(empty($coli_id)){
$toName = 'Sharon';
$toEmail = 'Sharon@hainatravel.com';
$fromEmail = $this->input->get_post('concatEmail');
$body = $this->input->get_post('addrequest');
if(empty($fromEmail) && empty($body)){
exit('error');
}
}else{
//获取该订单的操作员的邮箱以及姓名
$info = $this->BIZ_train_model->get_operatorInfo($coli_id);
$toName = $info[0]->OPI_Name;
$toEmail = $info[0]->OPI_Email;
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
}
$obj = $this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
if($obj){
exit('{"status":"200","reason":"邮件发送成功"}');
}else{
header("HTTP/1.1 404 Not Found");
exit('{"status":"404","reason":"邮件发送失败"}');
}
}
//导出账单api

Loading…
Cancel
Save