toEmail = user.getEmail();
}
try {
final MailMessageData message = new MailMessageData();
message.setFrom(options.getFromEmail());
message.setFromDisplayName(options.getFromName());
message.addRecipient(toEmail);
if (options.getReplyToEmail() != null)
{
// todo: api doesn't seem to support this?
}
message.setSubject(render(options.getSubjectTemplate(), options.getContext()));
message.setBodyText("text/plain", render(options.getBodyTemplate(), options.getContext()));
mailer.sendMessage(message);
} catch (IOException e) {
log.error("Unable to send mail", e);
}