// GET: Twilio public ActionResult Index() { var twilio = new TwilioApi(new Models.Pharmacy()); twilio.SendTextMessage(Models.Notification.GetTestNotification()); return(View()); }
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); } }
public static void SendNotification(Patient p, String message) { var twilio = new TwilioApi(p.getPharmacy()); twilio.SendTextMessage(p, message); }