Exemplo n.º 1
0
        public ActionResult TextTodaysVolunteers()
        {
            DateTime today = DateTime.Now;

            VolunteersDBEntities _db = new VolunteersDBEntities();

            var accountsid = "AC1e234cf4a6742315d15d6d0f457c3d55";
            var authToken  = "8f0c777ebd152c1145b6c90f82d29ac4";

            TwilioClient.Init(accountsid, authToken);

            var from = new PhoneNumber("+14193703444");

            foreach (string email in _db.TodaysVolunteersPhone(today.Date))
            {
                var message = MessageResource.Create(
                    to: "+1" + email,
                    from: from,
                    body: "This is an automated message from Challenged Champions Equestrian Center. Reminder: you are signed up for an event today!"
                    );
            }

            return(RedirectToAction("Communications", "Home"));
        }