Commit e25099a49e31251068b52d1178f180e68c47ce5c

Authored by 杨文
1 parent 12d6c14b

发送邮件逻辑优化,邮件标题支持模版参数

yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/mail/MailSendServiceImpl.java
... ... @@ -89,13 +89,14 @@ public class MailSendServiceImpl implements MailSendService {
89 89  
90 90 // 创建发送日志。如果模板被禁用,则不发送短信,只记录日志
91 91 Boolean isSend = CommonStatusEnum.ENABLE.getStatus().equals(template.getStatus());
  92 + String title = mailTemplateService.formatMailTemplateContent(template.getTitle(), templateParams);
92 93 String content = mailTemplateService.formatMailTemplateContent(template.getContent(), templateParams);
93 94 Long sendLogId = mailLogService.createMailLog(userId, userType, mail,
94 95 account, template, content, templateParams, isSend);
95 96 // 发送 MQ 消息,异步执行发送短信
96 97 if (isSend) {
97 98 mailProducer.sendMailSendMessage(sendLogId, mail, account.getId(),
98   - template.getNickname(), template.getTitle(), content);
  99 + template.getNickname(), title, content);
99 100 }
100 101 return sendLogId;
101 102 }
... ...