예제 #1
0
 public void  SavePasswordResetRequest(PasswordResetRequest request)
 {
     try
     {
         request.CreatedDate = DateTime.UtcNow;
         db.PasswordResetRequests.Add(request);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         throw;
     }
 }
예제 #2
0
 public void SavePasswordResetRequest(UserAccountDto userAccount, string activationLink)
 {
     try
     {
         var request = new PasswordResetRequest {
             ActivationCode = activationLink, UserID = userAccount.Id
         };
         request.CreatedDate = DateTime.UtcNow;
         db.PasswordResetRequests.Add(request);
         db.SaveChanges();
     }
     catch (Exception)
     {
         throw;
     }
 }
        public void SendResetPasswordEmail(PasswordResetRequest request)
        {
            var emailTemplate = repo.GetEmailTemplate("ResetPassword");
            if (emailTemplate != null)
            {                

                string emailSubject = emailTemplate.EmailSubject;
                string emailBody = emailTemplate.EmailBody;
                Email email = new Email();
                email.ToAddress.Add(request.User.EmailAddress);

                string joinLink = String.Format("{0}Account/resetpassword/{1}", SiteBaseURL, request.ActivationCode);
                emailBody = emailBody.Replace("@resetLink", joinLink);              
                email.Body = emailBody;
                email.Subject = emailSubject;
                email.Send();
            }


        }
 public void  SavePasswordResetRequest(PasswordResetRequest request)
 {
     try
     {
         request.CreatedDate = DateTime.UtcNow;
         db.PasswordResetRequests.Add(request);
         db.SaveChanges();
     }
     catch (Exception ex)
     {
         throw;
     }
 }