fix(消息通知): 修复测试计划执行结束后没有给执行人发通知的问题

--bug=1013979 --user=刘瑞斌 【消息通知】设置测试计划执行成功的邮件通知特定测试计划收不到消息 https://www.tapd.cn/55049933/s/1187352
This commit is contained in:
CaptainB 2022-06-21 17:10:30 +08:00 committed by f2c-ci-robot[bot]
parent 7ee21f06ff
commit 9616880d7a
1 changed files with 14 additions and 2 deletions

View File

@ -96,11 +96,23 @@ public class MailNoticeSender extends AbstractNoticeSender {
LogUtil.info("收件人地址: {}", Arrays.asList(users));
helper.setText(context, true);
helper.setTo(users);
// 有抄送
if (cc != null && cc.length > 0) {
helper.setCc(cc);
helper.setTo(users);
javaMailSender.send(mimeMessage);
}
// 无抄送
else {
for (String u : users) {
helper.setTo(u);
try {
javaMailSender.send(mimeMessage);
} catch (Exception e) {
LogUtil.error("发送邮件失败: ", e);
}
}
}
javaMailSender.send(mimeMessage);
}
public void sendExternalMail(String context, NoticeModel noticeModel) throws Exception {