예제 #1
0
        // GET: Twilio
        public ActionResult Index()
        {
            var twilio = new TwilioApi(new Models.Pharmacy());

            twilio.SendTextMessage(Models.Notification.GetTestNotification());
            return(View());
        }
예제 #2
0
        private static void SendNotification(Notification n, TwilioApi twilio)
        {
            System.Diagnostics.Debug.WriteLine("Sending Notification: " + n.NotificationId);
            var p = Patient.PatientDict[n.PatientId];

            if (n.Type == Notification.NotificationType.Recall)
            {
                twilio.MakeRecallPhoneCall(n);
                Notification.MarkSent(n);
            }
            else if (((n.Type == Notification.NotificationType.Refill || n.Type == Notification.NotificationType.Ready) && p.SendRefillMessage) || (n.Type == Notification.NotificationType.Birthday && p.SendBirthdayMessage))
            {
                switch (p.ContactMethod)
                {
                case Patient.PrimaryContactMethod.Call:
                    twilio.MakePhoneCall(n);
                    break;

                case Patient.PrimaryContactMethod.Email:
                    EmailService.SendNotification(n);
                    break;

                case Patient.PrimaryContactMethod.Text:
                    twilio.SendTextMessage(n);
                    break;

                case Patient.PrimaryContactMethod.OptOut:
                    // Do nothing
                    break;

                default:
                    break;
                }
                Notification.MarkSent(n);
            }
        }
예제 #3
0
        public static void SendNotification(Patient p, String message)
        {
            var twilio = new TwilioApi(p.getPharmacy());

            twilio.SendTextMessage(p, message);
        }