Exemplo n.º 1
0
        public void SendVerificationEmail(VerificationModel vModel, User user, string origin)
        {
            string message;

            if (!string.IsNullOrEmpty(origin))
            {
                message = $@"<p>Your conformation code:</p>
                             <p>{vModel.VerificationToken}</p>";
            }
            else
            {
                message = $@"<p>Please use the below token to verify your email address with the <code>/accounts/verify-email</code> api route:</p>
                             <p><code>{vModel.VerificationToken}</code></p>";
            }

            Send(
                to: user.Email,
                subject: "Foosball - Verify Email",
                html: $@"<h4>Verify Email</h4>
                         <p>Thanks for registering!</p>
                         {message}"
                );
        }
Exemplo n.º 2
0
        public void SendPasswordResetEmail(VerificationModel vModel, User user, string origin)
        {
            string message;

            if (!string.IsNullOrEmpty(origin))
            {
                var resetUrl = $"{origin}/auth/reset-password?token={vModel.PasswordResetToken}";
                message = $@"<p>Please click the below link to reset your password, the link will be valid for 1 day:</p>
                             <p><a href=""{resetUrl}"">{resetUrl}</a></p>";
            }
            else
            {
                message = $@"<p>Please use the below token to reset your password with the <code>/accounts/reset-password</code> api route:</p>
                             <p><code>{vModel.PasswordResetToken}</code></p>";
            }

            Send(
                to: user.Email,
                subject: "Foosball - Reset Password",
                html: $@"<h4>Reset Password Email</h4>
                         {message}"
                );
        }