コード例 #1
0
 @Async
 public void sendSocialRegistrationValidationEmail(User user, String provider) {
   log.debug("Sending social registration validation e-mail to '{}'", user.getEmail());
   Locale locale = Locale.forLanguageTag(user.getLangKey());
   Context context = new Context(locale);
   context.setVariable("user", user);
   context.setVariable("provider", WordUtils.capitalize(provider));
   String content = templateEngine.process("socialRegistrationValidationEmail", context);
   String subject = messageSource.getMessage("email.social.registration.title", null, locale);
   sendEmail(user.getEmail(), subject, content, false, true);
 }
コード例 #2
0
 @Async
 public void sendPasswordResetMail(User user, String baseUrl) {
   log.debug("Sending password reset e-mail to '{}'", user.getEmail());
   Locale locale = Locale.forLanguageTag(user.getLangKey());
   Context context = new Context(locale);
   context.setVariable("user", user);
   context.setVariable("baseUrl", baseUrl);
   String content = templateEngine.process("passwordResetEmail", context);
   String subject = messageSource.getMessage("email.reset.title", null, locale);
   sendEmail(user.getEmail(), subject, content, false, true);
 }