Exemple #1
0
        public ActionResult Create([Bind(Include = "Id,Name,EmailAddress,Subject,Body")] AvailableUnitInfoRequests availableUnitInfoRequests)
        {
            if (ModelState.IsValid)
            {
                db.AvailableUnitInfoRequests.Add(availableUnitInfoRequests);
                db.SaveChanges();

                MailGun managerMessage = new MailGun();
                managerMessage.SendAvailableUnitRequest(availableUnitInfoRequests.Name, availableUnitInfoRequests.EmailAddress, availableUnitInfoRequests.Subject, availableUnitInfoRequests.Body);

                return(RedirectToAction("MessageSuccess", "Messages"));
            }

            return(View(availableUnitInfoRequests));
        }