예제 #1
0
        public async Task SendForgotPasswordEmail(string emailAddress, string subject, CancellationToken cancellationToken = default(CancellationToken))
        {
            EnsureSettings();

            var identityEntity = await this.AuthenticationProvider.GetIdentityByEmail(emailAddress).ConfigureAwait(false);

            var verificationToken = await this.AuthenticationProvider.GenerateVerificationToken(identityEntity.IdentityId);

            var verificationTokenLink = this.ForgotPasswordRedirectUri.AbsoluteUri + verificationToken;

            var content = this.ForgotPasswordEmailTemplate;

            content = content.Replace("##__Subject__##", subject);
            content = content.Replace("##__CompanyName__##", this.CompanyName);
            content = content.Replace("##__VerificationTokenLink__##", verificationTokenLink);

            await MailgunClient.SendEmail(this.FromEmail, emailAddress, subject, content, cancellationToken);
        }