use of cz.metacentrum.perun.audit.events.MailManagerEvents.InvitationSentEvent in project perun by CESNET.
the class MailManagerImpl method sendInvitationMail.
/**
* Send invitation email to one user
*/
private void sendInvitationMail(PerunSession sess, Vo vo, Group group, String email, String language, MimeMessage message, Application app) throws RegistrarException {
try {
mailSender.send(message);
User sendingUser = sess.getPerunPrincipal().getUser();
AuditEvent event = new InvitationSentEvent(sendingUser, email, language, group, vo);
sess.getPerun().getAuditer().log(sess, event);
log.info("[MAIL MANAGER] Sending mail: USER_INVITE to: {} / {} / {}", message.getAllRecipients(), app.getVo(), app.getGroup());
} catch (MailException | MessagingException ex) {
log.error("[MAIL MANAGER] Sending mail: USER_INVITE failed because of exception.", ex);
throw new RegistrarException("Unable to send e-mail.", ex);
}
}
Aggregations