mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-29 18:51:53 +08:00
发送邮件逻辑优化,邮件标题支持模版参数
This commit is contained in:
parent
12d6c14b1c
commit
e25099a49e
@ -89,13 +89,14 @@ public class MailSendServiceImpl implements MailSendService {
|
|||||||
|
|
||||||
// 创建发送日志。如果模板被禁用,则不发送短信,只记录日志
|
// 创建发送日志。如果模板被禁用,则不发送短信,只记录日志
|
||||||
Boolean isSend = CommonStatusEnum.ENABLE.getStatus().equals(template.getStatus());
|
Boolean isSend = CommonStatusEnum.ENABLE.getStatus().equals(template.getStatus());
|
||||||
|
String title = mailTemplateService.formatMailTemplateContent(template.getTitle(), templateParams);
|
||||||
String content = mailTemplateService.formatMailTemplateContent(template.getContent(), templateParams);
|
String content = mailTemplateService.formatMailTemplateContent(template.getContent(), templateParams);
|
||||||
Long sendLogId = mailLogService.createMailLog(userId, userType, mail,
|
Long sendLogId = mailLogService.createMailLog(userId, userType, mail,
|
||||||
account, template, content, templateParams, isSend);
|
account, template, content, templateParams, isSend);
|
||||||
// 发送 MQ 消息,异步执行发送短信
|
// 发送 MQ 消息,异步执行发送短信
|
||||||
if (isSend) {
|
if (isSend) {
|
||||||
mailProducer.sendMailSendMessage(sendLogId, mail, account.getId(),
|
mailProducer.sendMailSendMessage(sendLogId, mail, account.getId(),
|
||||||
template.getNickname(), template.getTitle(), content);
|
template.getNickname(), title, content);
|
||||||
}
|
}
|
||||||
return sendLogId;
|
return sendLogId;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user