diff --git a/backend/src/main/java/io/metersphere/notice/service/MailService.java b/backend/src/main/java/io/metersphere/notice/service/MailService.java index 88312b9bd5..64f8306391 100644 --- a/backend/src/main/java/io/metersphere/notice/service/MailService.java +++ b/backend/src/main/java/io/metersphere/notice/service/MailService.java @@ -8,6 +8,7 @@ import io.metersphere.commons.constants.ParamConstants; import io.metersphere.commons.utils.EncryptUtils; import io.metersphere.commons.utils.LogUtil; import io.metersphere.dto.LoadTestDTO; +import io.metersphere.i18n.Translator; import io.metersphere.service.SystemParameterService; import io.metersphere.service.UserService; import io.metersphere.track.request.testreview.SaveCommentRequest; @@ -80,8 +81,9 @@ public class MailService { "\n" + "\n" + "
\n" + - "

" + type + "定时任务结果通知

\n" + - "

尊敬的用户:您好,您所执行的" + testName + "运行失败

\n" + + "

" + type + Translator.get("timing_task_result_notification") + "

\n" + + "

尊敬的用户:您好,


" + + "

您所执行的" + testName + "运行失败

\n" + "
\n" + "\n" + ""; @@ -93,7 +95,7 @@ public class MailService { "\n" + "\n" + "
\n" + - "

" + type + "定时任务结果通知

\n" + + "

" + type + Translator.get("timing_task_result_notification") + "

\n" + "

尊敬的用户:您好," + testName + "运行成功

\n" + "
\n" + "\n" + @@ -101,7 +103,7 @@ public class MailService { try { MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true); helper.setFrom(javaMailSender.getUsername()); - helper.setSubject("MeterSphere定时任务结果通知"); + helper.setSubject(Translator.get("timing_task_result_notification")); String users[] = {}; List successEmailList = new ArrayList<>(); List failEmailList = new ArrayList<>(); @@ -130,12 +132,12 @@ public class MailService { helper.setTo(users); } catch (MessagingException e) { - e.printStackTrace(); + LogUtil.error(e); } try { javaMailSender.send(mimeMessage); } catch (MailException e) { - e.printStackTrace(); + LogUtil.error(e); } } @@ -188,7 +190,7 @@ public class MailService { "\n" + "\n" + "
\n" + - "

" + reviewRequest.getCreator() + "发起的" + reviewRequest.getName() + "的计划开始时间是" + start + ",计划结束时间为" + end + "请跟进" + "

\n" + + "

" + reviewRequest.getCreator() + "发起的:" + "


" + reviewRequest.getName() + "


" + "计划开始时间是" + start + ",计划结束时间为" + end + "请跟进" + "

\n" + "
\n" + "\n" + ""; @@ -200,7 +202,7 @@ public class MailService { "\n" + "\n" + "
\n" + - "

" + testCaseWithBLOBs.getMaintainer() + "发起的" + testCaseWithBLOBs.getName() + "添加评论:" + request.getDescription() + "

\n" + + "

" + testCaseWithBLOBs.getMaintainer() + "发起的" + "


" + testCaseWithBLOBs.getName() + "


" + "添加评论:" + request.getDescription() + "

\n" + "
\n" + "\n" + ""; @@ -212,15 +214,14 @@ public class MailService { "\n" + "\n" + "
\n" + - "

" + reviewRequest.getCreator() + "发起的" + reviewRequest.getName() + "的计划开始时间是" + start + ",计划结束时间为" + end + "已完成" + "

\n" + + "

" + reviewRequest.getCreator() + "发起的:" + "


" + reviewRequest.getName() + "


" + "计划开始时间是" + start + ",计划结束时间为" + end + "已完成" + "

\n" + "
\n" + "\n" + ""; - ; try { MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true); helper.setFrom(javaMailSender.getUsername()); - helper.setSubject("测试评审任务通知"); + helper.setSubject(Translator.get("test_review_task_notice")); String users[] = {}; List emails = new ArrayList<>(); try { @@ -239,12 +240,12 @@ public class MailService { helper.setTo(users); } catch (MessagingException e) { - e.printStackTrace(); + LogUtil.error(e); } try { javaMailSender.send(mimeMessage); } catch (MailException e) { - e.printStackTrace(); + LogUtil.error(e); } } } diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index 145e7904ab..36695b9994 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -151,8 +151,9 @@ quota_max_threads_excess_workspace=The maximum number of concurrent threads exce quota_max_threads_excess_organization=The maximum number of concurrent threads exceeds the organization quota quota_duration_excess_workspace=The stress test duration exceeds the work space quota quota_duration_excess_organization=The stress test duration exceeds the organization quota - email_subject=Metersphere timing task result notification import_xmind_count_error=The number of use cases imported into the mind map cannot exceed 500 import_xmind_not_found=Test case not found license_valid_license_error=Authorization authentication failed +timing_task_result_notification="Timing task result notification" +test_review_task_notice="Test review task notice" diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 7836a2ba48..fc3e9a2d35 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -155,6 +155,7 @@ email_subject=MeterSphere定时任务结果通知 import_xmind_count_error=思维导图导入用例数量不能超过 500 条 license_valid_license_error=授权认证失败 import_xmind_not_found=未找到测试用例 - +timing_task_result_notification="定时任务结果通知" +test_review_task_notice="测试评审任务通知" diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index d2fdb48ea6..3b79d44b9b 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -153,8 +153,8 @@ quota_duration_excess_workspace=壓測時長超過工作空間限額 quota_duration_excess_organization=壓測時長超過組織限額 license_valid_license_error=授權驗證失敗 license_valid_license_code=授權碼已經存在 - - email_subject=MeterSphere定時任務結果通知 import_xmind_count_error=思維導圖導入用例數量不能超過 500 條 -import_xmind_not_found=未找到测试用例 \ No newline at end of file +import_xmind_not_found=未找到测试用例 +timing_task_result_notification="定時任務結果通知" +test_review_task_notice="測試評審任務通知" \ No newline at end of file