Ejemplo n.º 1
0
        public virtual void AddUserTokens(IList<Token> tokens, User user)
        {
            tokens.Add(new Token("User.Username", user.Username));
            tokens.Add(new Token("User.FullName", user.FormatUserName()));

            string accountActivationUrl = "{0}{1}".FormatWith(webHelper.AbsoluteWebRoot.ToString(),
                    SystemRouteUrls.AccountActivation.Replace("{userId}", user.UserGuid.ToString()).Replace("{token}",
                        user.GetAttribute<string>(SystemUserAttributeNames.AccountActivationToken)));
            tokens.Add(new Token("User.AccountActivationURL", accountActivationUrl, true));

            string passwordRecoveryUrl = "{0}{1}".FormatWith(webHelper.AbsoluteWebRoot.ToString(),
                    SystemRouteUrls.PasswordRecoveryConfirm.Replace("{userId}", user.UserGuid.ToString()).Replace("{token}",
                        user.GetAttribute<string>(SystemUserAttributeNames.PasswordRecoveryToken)));
            tokens.Add(new Token("User.PasswordRecoveryURL", passwordRecoveryUrl, true));
        }