添加退票后发送邮件给客人测试

feature/pay
cyc 6 years ago
parent a3c214f6f7
commit 521a20e536

@ -86,20 +86,38 @@ class returnorders extends CI_Controller{
log_message('error','聚合退票:'.$ticket_data->ts_ordernumber.'|'.$back_json);
$back_data = json_decode($back_json);
$fromName = 'trainsystem';
$fromEmail = 'cyc@hainatravel.com';
$coli_id = $this->BIZ_train_model->cold_sn_get_coli_id($ticket_data->ts_cold_sn);
$coli_id = $coli_id['0']->COLI_ID;
$info = $this->BIZ_train_model->get_operatorInfo($coli_id);
$toName = $info[0]->OPI_Name;
$toEmail = $info[0]->OPI_Email;
$Mobile = $info[0]->Mobile;
$subject = '退票请求';
if($back_data->error_code == '0'){
//退票成功后发送一封邮件
$fromName = 'trainsystem';
$fromEmail = 'cyc@hainatravel.com';
$coli_id = $this->BIZ_train_model->cold_sn_get_coli_id($ticket_data->ts_cold_sn);
$coli_id = $coli_id['0']->COLI_ID;
$info = $this->BIZ_train_model->get_operatorInfo($coli_id);
$toName = $info[0]->OPI_Name;
$toEmail = $info[0]->OPI_Email;
$subject = '退票请求';
//退票成功后发送邮件
$body = $back_detail_data->result->ordernumber.' 提出退票,乘客:'.$data->tst_realname.', '.$back_detail_data->result->start_time.' '.$back_detail_data->result->checi;
//发送邮件给外联
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
//发送邮件给客人
$customer_subject = 'returntickets';
$customer_body = '<p>Dear'.$data->tst_realname.',</p><p>Your tickets (for name '.$data->tst_realname.',train No. '.$back_detail_data->result->checi.')have been cancelled online successfully. Your travel advisor('.$toName.',email address:'.$toEmail',phone number (+86)'.$Mobile.')will contact you with the refund details via email within 24 hours.';
$customer_email = $this->BIZ_train_model->get_guest_info($coli_id);
$customer_email = $customer_email[0]->GUT_Email;
$this->Sendmail_model->SendMailToTable($toName,$toEmail,$data->tst_realname,'cyc@hainatravel.com',$customer_subject,$customer_body);
echo '{"reason":"退票成功","status":"200"}';
}else{
//退票失败后发送邮件
$body = $ticket_data->ts_ordernumber.'退票失败';
//发送邮件给外联
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
/发送邮件给客人
$customer_subject = 'returntickets';
$customer_body = '<p>Dear'.$data->tst_realname.',</p><p>Your application for online ticket cancellation (for name '.$data->tst_realname.', train No.'.$back_detail_data->result->checi.')has failed.Your travel advisor('.$toName.', email address: '.$toEmail.', phone number (+86)'.Mobile.'will contact you via email within 24 hours. Please call us if you need to contact us urgently.</p>';
$customer_email = $this->BIZ_train_model->get_guest_info($coli_id);
$customer_email = $customer_email[0]->GUT_Email;
$this->Sendmail_model->SendMailToTable($toName,$toEmail,$data->tst_realname,'cyc@hainatravel.com',$customer_subject,$customer_body);
header("HTTP/1.1 404 Not Found");
echo '{"reason":"退票失败","status":"404"}';
}
@ -147,8 +165,10 @@ class returnorders extends CI_Controller{
$info = $this->BIZ_train_model->get_operatorInfo($coli_id);
$toName = $info[0]->OPI_Name;
$toEmail = $info[0]->OPI_Email;
$Mobile = $info[0]->Mobile;
$subject = '退票请求';
$body = '乘客:'.$data->tst_realname.' 对订单:'.$data->ts_ordernumber.'发起退票请求!!!';
//发送邮件给外联
$this->Sendmail_model->SendMailToTable($fromName,$fromEmail,$toName,$toEmail,$subject,$body);
echo '{"reason":"退票成功","status":"200"}';
}else{

Loading…
Cancel
Save