Ejemplo n.º 1
0
        public bool SendResetPasswordEmail(string email, string subject, string body, string passwordHash, string resetUrl)
        {
            var mailSettings = EmailBase.GetNotificationSettings();

            if (mailSettings != null)
            {
                var emailMessage = new Models.ResetPassword();
                emailMessage.From     = mailSettings.From;
                emailMessage.To       = email;
                emailMessage.Subject  = subject;
                emailMessage.Header   = mailSettings.MailHeader.ToString();
                emailMessage.Footer   = mailSettings.MailFooter.ToString();
                emailMessage.Body     = body;
                emailMessage.Token    = passwordHash;
                emailMessage.ResetUrl = resetUrl;
                var result = EmailBase.SendEmail(emailMessage, Log);
                if (result.Success)
                {
                    return(true);
                }
                else
                {
                    Log.Error(result.Exception.Message, result.Exception);
                    return(false);
                }
            }
            Log.Error("Unable to get notification settings");
            return(false);
        }
Ejemplo n.º 2
0
        private static Models.ResetPassword CreateResetPasswordEmailMessage(string email, string subject, string body,
                                                                            string passwordHash, string resetUrl,
                                                                            NotificationSettings mailSettings)
        {
            var emailMessage = new Models.ResetPassword();

            emailMessage.From     = mailSettings.From;
            emailMessage.To       = email;
            emailMessage.Subject  = subject;
            emailMessage.Header   = mailSettings.MailHeader.ToString();
            emailMessage.Footer   = mailSettings.MailFooter.ToString();
            emailMessage.Body     = body;
            emailMessage.Token    = passwordHash;
            emailMessage.ResetUrl = resetUrl;
            return(emailMessage);
        }
 private static Models.ResetPassword CreateResetPasswordEmailMessage(string email, string subject, string body,
                                                              string passwordHash, string resetUrl,
                                                              NotificationSettings mailSettings)
 {
     var emailMessage = new Models.ResetPassword();
     emailMessage.From = mailSettings.From;
     emailMessage.To = email;
     emailMessage.Subject = subject;
     emailMessage.Header = mailSettings.MailHeader.ToString();
     emailMessage.Footer = mailSettings.MailFooter.ToString();
     emailMessage.Body = body;
     emailMessage.Token = passwordHash;
     emailMessage.ResetUrl = resetUrl;
     return emailMessage;
 }