Commit 15365f2d by zhangxingmin

log日志

parent 82a0b89d
......@@ -123,6 +123,7 @@ public class ApiEmailSendServiceImpl implements ApiEmailSendService {
// 遍历所有收件人,逐个发送邮件
for (EmailTaskRecipients recipient : recipients) {
try {
log.info("遍历所有收件人,逐个发送邮件->recipient单个对象:{}",JSON.toJSONString(recipient));
// 添加发送间隔,避免频率过高
if (successCount > 0) {
Thread.sleep(2000); // 2秒间隔
......@@ -138,10 +139,14 @@ public class ApiEmailSendServiceImpl implements ApiEmailSendService {
//抄送人邮箱列表
apiSendMailDto.setCcEmailList(ccEmailList);
//邮件内容
log.info("邮件内容->StringUtil.hasPlaceholdersSimple(apiSendMailDto.getContent())前置:{}",apiSendMailDto.getContent());
if (StringUtil.hasPlaceholdersSimple(apiSendMailDto.getContent())) {
log.info("邮件内容->StringUtil.hasPlaceholdersSimple(apiSendMailDto.getContent())后置:{}",apiSendMailDto.getContent());
//检测内容是否有占位符,有占位符就替换具体内容,每收件人的占位符内容是不一样的。
log.info("apiSendMailDto.setContent前置:{}","Content: "+apiSendMailDto.getContent() + "Variables: "+ JSON.toJSONString(recipient.getVariables()));
apiSendMailDto.setContent(StringUtil.replacePlaceholders(apiSendMailDto.getContent(),
recipient.getVariables()));
log.info("apiSendMailDto.setContent后置:{}","Content: "+apiSendMailDto.getContent() + "Variables: "+ JSON.toJSONString(recipient.getVariables()));
}
// 调用邮件服务发送邮件
apiEmailService.sendMail(apiSendMailDto);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment