public ActionResult SendGroupKey(ShoppingCart cart) { EmailGroupKeyModel egkm = new EmailGroupKeyModel(); ViewBag.cartkey = cart.CartKey; egkm.Name = cart.PersonName; return(PartialView(egkm)); }
public ActionResult EmailKey(EmailGroupKeyModel egkm, ShoppingCart cart) { HandleCart(cart); ViewBag.result = string.Empty; ViewBag.cartkey = cart.CartKey; if (ModelState.IsValid) { EmailManager em = new EmailManager(); EmailContents ec = new EmailContents(); ec.FromEmailAddress = Globals.Settings.ContactForm.MailFrom; ec.FromName = "FoodReady.Net"; ec.Subject = egkm.Name + " is inviting you to join food orderong"; ec.To = egkm.Email; // send to FoodReady.Net ec.Body = "<p>The group key:" + cart.CartKey + "</p><p>" + egkm.Message + "</p>"; em.Send(ec); ViewBag.result = "Email has been successfully sent."; } return(PartialView(egkm)); }