@Override
protected void prepareMessage(MimeMessageHelper helper,
Map<Object, Object> context) throws Exception {
Long userId = (Long) context.get("userId");
Long projectId = (Long) context.get("projectId");
User user = userService.getUser(userId);
Project project = projectService.getProject(projectId);
context.put("user", user);
context.put("project", project);
context.put("site", project.getCategory().getSite());
helper.addTo(user.getEmail(), user.getNickname());
//
String subject = FreeMarkerTemplateUtils.processTemplateIntoString(
configuration.getTemplate(USER_REGISTER_SUBJECT), context);
String content = FreeMarkerTemplateUtils.processTemplateIntoString(
configuration.getTemplate(USER_REGISTER_CONTENT), context);
helper.setSubject(subject);
helper.setText(content, true);
//
user.setEnabled(false);
userService.updateUser(user);
}