Esempio n. 1
0
  /**
   * This sends another confirmation email if the
   *
   * @param email The email to send another confirmation email to.
   */
  @Transactional
  public Result generateNewConfirmation(String email) {
    // Check to see if the email exists. If it does not return
    // a valid "User", then we display the error page.
    User user = User.findByEmail(email);
    if (user != null) {
      // Generate a new confirmation code and send out another email.
      user = User.setNotAuthenticated(email);
      myEmailGenerator.generateConfirmationEmail(user.firstName, user.email, user.confirmationCode);

      // Render registration success page.
      return ok(registrationSuccess.render());
    } else {
      // Render the account error page
      return ok(accountError.render());
    }
  }