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

Merge pull request !485 from 傲世孤尘/feature/20230519
This commit is contained in:
芋道源码 2023-05-21 15:35:37 +00:00 committed by Gitee
commit 3b92042d4b
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -89,13 +89,14 @@ public class MailSendServiceImpl implements MailSendService {
// 创建发送日志如果模板被禁用则不发送短信只记录日志
Boolean isSend = CommonStatusEnum.ENABLE.getStatus().equals(template.getStatus());
String title = mailTemplateService.formatMailTemplateContent(template.getTitle(), templateParams);
String content = mailTemplateService.formatMailTemplateContent(template.getContent(), templateParams);
Long sendLogId = mailLogService.createMailLog(userId, userType, mail,
account, template, content, templateParams, isSend);
// 发送 MQ 消息异步执行发送短信
if (isSend) {
mailProducer.sendMailSendMessage(sendLogId, mail, account.getId(),
template.getNickname(), template.getTitle(), content);
template.getNickname(), title, content);
}
return sendLogId;
}