作者 邓超

自动回复

@@ -83,6 +83,7 @@ class fob_ai_mail_auto_reply { @@ -83,6 +83,7 @@ class fob_ai_mail_auto_reply {
83 // 查询数据 83 // 查询数据
84 $data = $this->db->throw()->first(\Model\listsSql::first('`id` = '.$did,'`id`,`folder_id`,`email_id`,`subject`,`is_hots`,`from`,`udate`')); 84 $data = $this->db->throw()->first(\Model\listsSql::first('`id` = '.$did,'`id`,`folder_id`,`email_id`,`subject`,`is_hots`,`from`,`udate`'));
85 if($data && !$data['is_hots']){ 85 if($data && !$data['is_hots']){
  86 + _echo('处理 '.$data['id']);
86 // 不是屏蔽的 87 // 不是屏蔽的
87 $body = getBodyHtml(getMailBody($data['id'])); 88 $body = getBodyHtml(getMailBody($data['id']));
88 if(isAiAutoMail($data['from'],$data['subject'],$body)===0){ 89 if(isAiAutoMail($data['from'],$data['subject'],$body)===0){
@@ -97,12 +98,15 @@ class fob_ai_mail_auto_reply { @@ -97,12 +98,15 @@ class fob_ai_mail_auto_reply {
97 $replySetting = $this->getAutoReplySetting($postid,$email['email']); 98 $replySetting = $this->getAutoReplySetting($postid,$email['email']);
98 if($replySetting){ 99 if($replySetting){
99 // 有配置才回复 100 // 有配置才回复
100 - $this->log([$data,$replySetting]); // 立即写入日志  
101 - \Lib\Mail\MailFun::sendEmail([ 101 + $ret = \Lib\Mail\MailFun::sendEmail([
102 'subject' => 'Re:'.$data['subject'], 102 'subject' => 'Re:'.$data['subject'],
103 'tos' => [['email'=>$data['from'],'name'=>explode('@',$data['from'])[0]]], 103 'tos' => [['email'=>$data['from'],'name'=>explode('@',$data['from'])[0]]],
104 'body' => $this->trimBody($replySetting['content'],$body) 104 'body' => $this->trimBody($replySetting['content'],$body)
105 ],$email); 105 ],$email);
  106 + _echo('回复成功'.$data['id'].'==='.$postid);
  107 + $this->log([$data,$replySetting,$ret]); // 立即写入日志
  108 + }else{
  109 + _echo('没有找到配置'.$data['id'].'==='.$postid);
106 } 110 }
107 111
108 } 112 }