Esempio n. 1
0
        public ActionResult SendEmail(int id)
        {
            var customer = db.Patients.Find(id);

            var model = new CustomerEmailModel
            {
                Patient = customer,
                Email   = customer.Email,
                //Subject = "test"
            };

            return(View(model));
        }
Esempio n. 2
0
        public ActionResult SendEmail(CustomerEmailModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var customer = db.Patients.Where(o => o.Email == model.Email).FirstOrDefault();

            //EmailExtensions.SendMail(model.Email, model.Subject, model.Body);

            EmailExtensions.SendSms(customer.ContactNumber, model.Body);

            return(RedirectToAction("Index"));
        }