protected void Page_Load(object sender, EventArgs e)
        {
            if(!string.IsNullOrEmpty(Request["email"]))
            {
                Session["email"] = StringHelper.RemovePossibleXSS(Request["email"]);
                try
                {
                    var orderNum = Guid.NewGuid().ToString();
                    var order = new Order
                                    {
                                        Email = Session["Email"].ToString(),
                                        HasBeenProcessed = 0,
                                        OrderNumber = orderNum
                                    };
                    var order2 = new Order
                                     {
                                         Email = Session["Email"].ToString(),
                                         HasBeenProcessed = 2,
                                         OrderNumber = orderNum
                                     };
                    var orderRepo = new OrderRepository();
                    orderRepo.PlaceOrder(order, ProcessedValue.Download);
                    orderRepo.PlaceOrder(order2, ProcessedValue.Map);
                    EmailerFactory.NewDefaultInstance().SendHtmlEmail(ConfigurationManager.AppSettings["FromEmail"],
                                  ConfigurationManager.AppSettings["ToshEmail"],
                                  "Order Placed Please Verify And Ship Via The Control Panel",
                                  "Please Go To obamainhydepark.com/Admin/AdminPanel.aspx And Verify & Approve The Order Of Order Id = " +
                                  order.OrderNumber);
                }
                catch(Exception ex)
                {

                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     var str = Request.Params.AllKeys.Aggregate("", (current, key) => current + (key + ":" + Request[key]));
     var emailer = new Emailer(ConfigurationManager.AppSettings["SmtpServer"], "", "", 25);
     emailer.SendHtmlEmail(ConfigurationManager.AppSettings["FromEmail"], "*****@*****.**", "Obama in hyde park", str);
     if (string.Compare(Request["payment_status"], "Completed", true, CultureInfo.CurrentCulture) != 0 && !string.IsNullOrEmpty(Request["invoice"]))
         return;
     try
     {
         var orderNum = Guid.NewGuid().ToString();
         var order = new Order
                         {
                             Email = Session["Email"].ToString(),
                             HasBeenProcessed = 0,
                             OrderNumber = orderNum
                         };
         var order2 = new Order
                          {
                              Email = Session["Email"].ToString(),
                              HasBeenProcessed = 2,
                              OrderNumber = orderNum
                          };
         var orderRepo = new OrderRepository();
         orderRepo.PlaceOrder(order);
         orderRepo.PlaceOrder(order2);
         EmailerFactory.SendDownloadLink(order, order2);
         litMessage.Text = "The Obama Tour Link Was Sent To Your Email! Click The Link To Download It!";
     }
     catch(Exception ex)
     {
         litMessage.Text = "An Error Occurred Please Contact Us Error: " + ex;
     }
 }
        public static void SendDownloadLink(Order order, Order mapOrder)
        {
            var emailer = NewDefaultInstance();

            var name = order.Email;
            var body = "Hello " + name + ", <br/>This email is to let you know your download of Obama in Hyde Park's Audio/Visual Tour is ready to be downloaded go to <a href='http://obamainhydepark.com/Download.aspx?ordernumber=" + order.OrderNumber + "'>Our Download Page</a> To Download it today! <br/> Visit <a href='http://obamainhydepark.com/Map.aspx?OrderNumber=" + mapOrder.OrderNumber + "'>Our Map Section</a> For Exclusive Walking Directions <br/> Thank You! <br/> The Obama In Hyde Park Team";
            const string subject = "Obama In Hyde Park Team - Your download is ready of the Walking Tour You purchased!";
            emailer.SendHtmlEmail(ConfigurationManager.AppSettings["FromEmail"], order.Email, subject, body);
        }