use of com.hccake.ballcat.common.mail.model.MailDetails in project ballcat by ballcat-projects.
the class MailSender method sendMail.
/**
* 发送邮件
* @param subject 主题
* @param content 邮件正文
* @param showHtml 是否将正文渲染为html
* @param to 收件人,多个邮箱使用,号间隔
* @return MailSendInfo
*/
default MailSendInfo sendMail(String subject, String content, boolean showHtml, String... to) {
MailDetails mailDetails = new MailDetails();
mailDetails.setShowHtml(showHtml);
mailDetails.setSubject(subject);
mailDetails.setContent(content);
mailDetails.setTo(to);
return sendMail(mailDetails);
}
use of com.hccake.ballcat.common.mail.model.MailDetails in project ballcat by ballcat-projects.
the class MailNotifyPusher method push.
@Override
public void push(NotifyInfo notifyInfo, List<SysUser> userList) {
String[] emails = userList.stream().map(SysUser::getEmail).filter(StrUtil::isNotBlank).toArray(String[]::new);
// 密送群发,不展示其他收件人
MailDetails mailDetails = new MailDetails();
mailDetails.setShowHtml(true);
mailDetails.setSubject(notifyInfo.getTitle());
mailDetails.setContent(notifyInfo.getContent());
mailDetails.setBcc(emails);
mailSender.sendMail(mailDetails);
}
Aggregations