private void SendResetEmail(User user, string subject, string message, string applicationUrl)
        {
            using (LogGroup logGroup = LogGroup.StartDebug("Sending reset email."))
            {
                string title    = Configuration.Config.Application.Title;
                string resetUrl = applicationUrl.Trim('/') + "/ChangePassword.aspx?p=" + user.Password + "&u=" + user.Email;

                message = message.Replace("${ResetUrl}", resetUrl);
                message = message.Replace("${Title}", title);

                string fromEmail = "*****@*****.**";
                if (Config.Application.Settings.ContainsKey("SystemEmail") &&
                    Config.Application.Settings.GetString("SystemEmail") != String.Empty)
                {
                    fromEmail = Config.Application.Settings.GetString("SystemEmail");
                }

                LogWriter.Debug("To email: " + user.Email);
                LogWriter.Debug("From email: " + fromEmail);
                LogWriter.Debug("Subject: " + subject);
                LogWriter.Debug("Message: " + message);

                SendEmailStrategy.New(RequireAuthorisation).SendEmail(subject,
                                                                      message,
                                                                      "System",
                                                                      fromEmail,
                                                                      user.Name,
                                                                      user.Email);
            }
        }
Пример #2
0
        static public SendEmailStrategy New(bool requiresAuthorisation)
        {
            SendEmailStrategy strategy = new SendEmailStrategy();

            strategy.RequireAuthorisation = true;
            return(strategy);
        }
 public static SendEmailStrategy New(bool requiresAuthorisation)
 {
     SendEmailStrategy strategy = new SendEmailStrategy();
       			strategy.RequireAuthorisation = true;
       			return strategy;
 }