rename email msg subject

pull/923/head
baymax55 3 years ago
parent 3ef45f2b51
commit 8d069c941f

@ -69,8 +69,9 @@ public class EmailSendMessageHandler implements SendMessageHandler<AlarmNotifyRe
dataModel.put("interval", notifyConfig.getInterval().toString());
String emailAlarmTxt = Singleton.get(emailAlarmTxtKey, () -> FileUtil.readUtf8String(emailAlarmTxtKey));
String renderedEmailAlarmTxt = render(dataModel, emailAlarmTxt);
String alarmSubject = render(dataModel, EmailAlarmConstants.Email_ALARM_TITLE);
String[] recipients = notifyConfig.getReceives().split(",");
execute(recipients, EmailAlarmConstants.Email_ALARM_TITLE, renderedEmailAlarmTxt);
execute(recipients, alarmSubject, renderedEmailAlarmTxt);
} catch (Exception e) {
log.error("Email failed to send message", e);
}
@ -81,10 +82,11 @@ public class EmailSendMessageHandler implements SendMessageHandler<AlarmNotifyRe
try {
String emailConfigTxtKey = "message/robot/dynamic-thread-pool/email-config.ftl";
Map<String, String> dataModel = getDataModel(changeParameterNotifyRequest);
String emailAlarmTxt = Singleton.get(emailConfigTxtKey, () -> FileUtil.readUtf8String(emailConfigTxtKey));
String renderedEmailAlarmTxt = render(dataModel, emailAlarmTxt);
String emailConfigTxt = Singleton.get(emailConfigTxtKey, () -> FileUtil.readUtf8String(emailConfigTxtKey));
String renderedEmailConfigTxt = render(dataModel, emailConfigTxt);
String configSubject = render(dataModel, EmailAlarmConstants.Email_NOTICE_TITLE);
String[] recipients = notifyConfig.getReceives().split(",");
execute(recipients, EmailAlarmConstants.Email_NOTICE_TITLE, renderedEmailAlarmTxt);
execute(recipients, configSubject, renderedEmailConfigTxt);
} catch (Exception e) {
log.error("Email failed to send message", e);
}

@ -25,10 +25,10 @@ public class EmailAlarmConstants {
/**
* Thread Pool Alert Notification Title
*/
public static final String Email_ALARM_TITLE = "动态线程池告警";
public static String Email_ALARM_TITLE = "【Hippo4J】${active}-${threadPoolId} 线程池 ${notifyTypeEnum} 预警";
/**
* Thread pool parameter change notification title
*/
public static final String Email_NOTICE_TITLE = "动态线程池通知";
public static String Email_NOTICE_TITLE = "【Hippo4J】${active}-${threadPoolId} 线程池参数变更通知";
}

@ -1,8 +1,3 @@
<style>
li {
list-style-type: none;
}
</style>
<span style="color: rgb(255, 0, 0);">[警报] </span>${active} - 动态线程池运行告警(${notifyTypeEnum}
<ul>
<li>线程池ID<span style="color: rgb(160, 0, 0);">${threadPoolId}</span></li>
@ -25,3 +20,9 @@
</ul>
<b> 播报时间:${date} </b>
<style>
li {
list-style-type: none;
}
</style>

@ -1,6 +1,3 @@
<style>
li{list-style-type:none;}
</style>
<span style="color: rgb(0, 240, 0); ">[通知] </span>${active} - 动态线程池参数变更
<ul>
<li>线程池ID<span style="color: rgb(160, 0, 0);">${threadPoolId}</span></li>
@ -19,3 +16,9 @@
</ul>
<b> 播报时间:${date} </b>
<style>
li {
list-style-type: none;
}
</style>

Loading…
Cancel
Save