Search in sources :

Example 1 with MailDetails

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);
}
Also used : MailDetails(com.hccake.ballcat.common.mail.model.MailDetails)

Example 2 with 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);
}
Also used : SysUser(com.hccake.ballcat.system.model.entity.SysUser) MailDetails(com.hccake.ballcat.common.mail.model.MailDetails)

Aggregations

MailDetails (com.hccake.ballcat.common.mail.model.MailDetails)2 SysUser (com.hccake.ballcat.system.model.entity.SysUser)1