邮箱告警配置优化:将"spring.mail.from"与"spring.mail.username"属性拆分开,更加灵活的支持一些无密码邮箱服务;

pull/22/MERGE
xuxueli 5 years ago
parent 5ce480cf42
commit 2ab52d023d

@ -1963,7 +1963,8 @@ data: post-data
### 7.31 版本 v2.2.1 Release Notes[迭代中] ### 7.31 版本 v2.2.1 Release Notes[迭代中]
- 1、Cron编辑器增强Cron编辑器修改cron时可实时查看最近运行时间; - 1、Cron编辑器增强Cron编辑器修改cron时可实时查看最近运行时间;
- 2、Cron编辑器问题修复修复小概率情况下cron单个字段修改时导致其他字段被重置问题 - 2、Cron编辑器问题修复修复小概率情况下cron单个字段修改时导致其他字段被重置问题
- 3、[迭代中] 新增任务属性 "XxlJobContent" ,统一维护任务上下文信息,方便运行时存取任务相关信息; - 3、邮箱告警配置优化将"spring.mail.from"与"spring.mail.username"属性拆分开,更加灵活的支持一些无密码邮箱服务;
- 4、[迭代中] 新增任务属性 "XxlJobContent" ,统一维护任务上下文信息,方便运行时存取任务相关信息;
### TODO LIST ### TODO LIST

@ -65,7 +65,7 @@ public class EmailJobAlarm implements JobAlarm {
MimeMessage mimeMessage = XxlJobAdminConfig.getAdminConfig().getMailSender().createMimeMessage(); MimeMessage mimeMessage = XxlJobAdminConfig.getAdminConfig().getMailSender().createMimeMessage();
MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true); MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
helper.setFrom(XxlJobAdminConfig.getAdminConfig().getEmailUserName(), personal); helper.setFrom(XxlJobAdminConfig.getAdminConfig().getEmailFrom(), personal);
helper.setTo(email); helper.setTo(email);
helper.setSubject(title); helper.setSubject(title);
helper.setText(content, true); helper.setText(content, true);

@ -56,7 +56,7 @@ public class XxlJobAdminConfig implements InitializingBean, DisposableBean {
private String accessToken; private String accessToken;
@Value("${spring.mail.from}") @Value("${spring.mail.from}")
private String emailUserName; private String emailFrom;
@Value("${xxl.job.triggerpool.fast.max}") @Value("${xxl.job.triggerpool.fast.max}")
private int triggerPoolFastMax; private int triggerPoolFastMax;
@ -98,8 +98,8 @@ public class XxlJobAdminConfig implements InitializingBean, DisposableBean {
return accessToken; return accessToken;
} }
public String getEmailUserName() { public String getEmailFrom() {
return emailUserName; return emailFrom;
} }
public int getTriggerPoolFastMax() { public int getTriggerPoolFastMax() {

Loading…
Cancel
Save