ソースを参照

iiiii

Signed-off-by: binren <zhangbr@elab-plus.com>
binren 5 年 前
コミット
e94addaf59
1 ファイル変更11 行追加11 行削除
  1. 11 11
      jianye_report.py

+ 11 - 11
jianye_report.py

@@ -494,17 +494,17 @@ class JianYeReport(object):
 
     def send_mail(self, mail, send_mail_log):
         result = None
-        # for m in self.customer_mails:
-        if len(mail) == 6:
-            result = self.mail_util.send_mail_by_admin(mail[0], mail[1], mail[2], mail[3], mail[4])
-        elif len(mail) == 8:
-            result = self.mail_util.send_mail_by_admin(mail[0], mail[1], mail[2], mail[3], mail[4], mail[6],
-                                                  mail[7])
-        if result:
-            # name, mail, report_name, push_time, send_status, status, error_message
-            send_mail_log.append([mail[5], mail[2], mail[3], 1, 'success'])
-        else:
-            send_mail_log.append([mail[5], mail[2], mail[3], -1, '调用邮件接口失败:{}'.format(str(result))])
+        for m in self.customer_mails:
+            if len(mail) == 6:
+                    result = self.mail_util.send_mail_by_admin(mail[0], mail[1], m, mail[3], mail[4])
+            elif len(mail) == 8:
+                result = self.mail_util.send_mail_by_admin(mail[0], mail[1], m, mail[3], mail[4], mail[6],
+                                                      mail[7])
+            if result:
+                # name, mail, report_name, push_time, send_status, status, error_message
+                send_mail_log.append([mail[5], mail[2], mail[3], 1, 'success'])
+            else:
+                send_mail_log.append([mail[5], mail[2], mail[3], -1, '调用邮件接口失败:{}'.format(str(result))])
         return send_mail_log
 
     def get_house_ids(self, ids_str):