Example #1
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         var userLogic = new UserManager();
         var newPass   = userLogic.ResetPassword(txtEmail.Text);
         if (newPass == null)
         {
             lblMessage.Text = "This Email Address wasn't found in our system!";
             return;
         }
         var emailer = EmailerFactory.NewDefaultInstance();
         emailer.SendHtmlEmail(ConfigurationManager.AppSettings["FromEmail"], txtEmail.Text, "The Rolling Rides Team - Password Reset", "Hello," + "<br/>Your new password is " + newPass + "<br/>Thank you,<br/>The Rolling Rides Team");
         lblMessage.Text = "Your new temporary password was emailed to your email address provided";
     }
     catch (Exception ex)
     {
         lblMessage.Text = ex.Message;
     }
 }
Example #2
0
        protected void EmailCustomer(object sender, EventArgs e)
        {
            var user    = _userManager.GetById(int.Parse(((Button)sender).CommandArgument));
            var emailer = EmailerFactory.NewDefaultInstance();
            var days    = "Past Due!";

            if (DateTime.Now <= user.Expires.Value)
            {
                var timespan = DateTime.Now.Subtract(user.Expires.Value);
                days = "due in " + timespan.Days;
            }


            var name = !string.IsNullOrEmpty(user.CompanyName)
                           ? user.CompanyName
                           : !string.IsNullOrEmpty(user.LastName) && !string.IsNullOrEmpty(user.FirstName)
                                 ? user.FirstName + " " + user.LastName
                                 : user.Username;
            var body = "Hello " + name + ", <br/>This email is to let you know your bill for your coporate account is " + days
                       + "<br/>Please Visit Us At www.RollingRides.com/Contact.aspx and Contact Us to make a payment.<br/>Thank you<br/>Sincerely,<br/>The Rolling Rides Team!";
            var subject = "The Rolling Rides Team - Your bill is " + days;

            emailer.SendHtmlEmail(ConfigurationManager.AppSettings["FromEmail"], user.Email, subject, body);
        }