public void SendEmailValidationToken(User user) { if (user.EmailConfirmedOn != null) { throw new SimpleException(string.Format("The email '{0}' is already confirmed", user.Email)); } var token = _hashService.CreateTokenWithUserId(user.UserId, Constants.EmailVerificationTokenLen); user.EmailConfirmationToken = token; UpdateUser(user); MailSrv.SendPreDefMailAsync(user, MailType.EmailConfirmation, null); AddUserLog(user.UserId, "Email validation token send"); }