add 邮件发送日志

This commit is contained in:
lijiarao
2024-07-09 14:57:59 +08:00
parent 88c0115629
commit b0bcd0259d
2 changed files with 5 additions and 1 deletions
@@ -107,6 +107,7 @@ public class SendMessageServiceImpl implements SendMessageService {
Integer sendEmailFlag = sendMessageDTO.getSendEmailFlag();
LoginUser loginUser = sysBaseAPI.getUserByName(fromUser);
if(templateType.contains(ProjectCommon.MESSAGE_TYPE2) && !CommonConstant.DEL_FLAG_0.equals(sendEmailFlag)){
log.info("开始发送邮件");
if(StringUtils.isEmpty(sendMessageDTO.getEmail())){
throw new JeroBootException("邮件发送,邮箱地址不能为空!");
}
@@ -5,6 +5,7 @@ import com.jero.common.util.SpringContextUtils;
import com.jero.common.util.oConvertUtils;
import com.jero.config.StaticConfig;
import com.jero.modules.message.handle.ISendMsgHandle;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -20,7 +21,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
@Slf4j
public class EmailSendMsgHandle implements ISendMsgHandle {
static String emailFrom;
private String email;
@@ -94,6 +95,7 @@ public class EmailSendMsgHandle implements ISendMsgHandle {
// helper.addAttachment(attachmentsMailNameDispose(uploadEXECL), file);
// helper.addAttachment(attachmentsMailNameDispose(uploadCAD), file);
mailSender.send(message);
log.info("发送邮件成功");
} catch (MessagingException e) {
e.printStackTrace();
}
@@ -178,6 +180,7 @@ public class EmailSendMsgHandle implements ISendMsgHandle {
}
}
mailSender.send(message);
log.info("发送邮件和文件成功");
}
}
}catch (MessagingException e) {