正在显示
1 个修改的文件
包含
13 行增加
和
0 行删除
| @@ -138,6 +138,17 @@ class fob_ai_mail_auto_reply { | @@ -138,6 +138,17 @@ class fob_ai_mail_auto_reply { | ||
| 138 | // 配置 | 138 | // 配置 |
| 139 | $replySetting = $this->getAutoReplySetting($postid,$email['email']); | 139 | $replySetting = $this->getAutoReplySetting($postid,$email['email']); |
| 140 | if($replySetting){ | 140 | if($replySetting){ |
| 141 | + $isnext = true; | ||
| 142 | + if($replySetting['reply_num']??0){ | ||
| 143 | + $nk = 'fobaimailautoreplynum:'.$postid.':'.md5($data['from']); | ||
| 144 | + if(redis()->get($nk,0) > $replySetting['reply_num']){ | ||
| 145 | + $isnext = false; | ||
| 146 | + }else{ | ||
| 147 | + redis()->incr($nk); | ||
| 148 | + } | ||
| 149 | + } | ||
| 150 | + | ||
| 151 | + if($isnext){ | ||
| 141 | // 有配置才回复 | 152 | // 有配置才回复 |
| 142 | $ret = \Lib\Mail\MailFun::sendEmail([ | 153 | $ret = \Lib\Mail\MailFun::sendEmail([ |
| 143 | 'subject' => 'Re:'.$data['subject'], | 154 | 'subject' => 'Re:'.$data['subject'], |
| @@ -146,6 +157,8 @@ class fob_ai_mail_auto_reply { | @@ -146,6 +157,8 @@ class fob_ai_mail_auto_reply { | ||
| 146 | ],$email); | 157 | ],$email); |
| 147 | _echo('回复成功'.$data['id'].'==='.$postid); | 158 | _echo('回复成功'.$data['id'].'==='.$postid); |
| 148 | $this->log([$data,$replySetting,$ret]); // 立即写入日志 | 159 | $this->log([$data,$replySetting,$ret]); // 立即写入日志 |
| 160 | + } | ||
| 161 | + | ||
| 149 | }else{ | 162 | }else{ |
| 150 | _echo('没有找到配置'.$data['id'].'==='.$postid); | 163 | _echo('没有找到配置'.$data['id'].'==='.$postid); |
| 151 | } | 164 | } |
-
请 注册 或 登录 后发表评论