From f3fd51239b9080e2ff9aff381eca7a3f200d6652 Mon Sep 17 00:00:00 2001 From: James Schafer Date: Sat, 10 Jun 2017 22:36:13 -0400 Subject: [PATCH] Created Initial NotificationEmailSender and Added it to the Melody49Notifier. --- Melody49Notifier/Melody49Notifier.cs | 7 ++++-- .../Notification/NotificationEmailSender.cs | 25 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 Melody49Notifier/Notification/NotificationEmailSender.cs diff --git a/Melody49Notifier/Melody49Notifier.cs b/Melody49Notifier/Melody49Notifier.cs index 56165d7..7b12938 100644 --- a/Melody49Notifier/Melody49Notifier.cs +++ b/Melody49Notifier/Melody49Notifier.cs @@ -3,6 +3,7 @@ using Microsoft.Azure.WebJobs.Host; using Melody49Notifier.DataAbstraction; using Melody49Notifier.Models; +using Melody49Notifier.Notification; namespace Melody49Notifier { @@ -10,7 +11,7 @@ public static class Melody49Notifier { [FunctionName("Melody49Notifier")] - public static void Run([TimerTrigger("0/10 * * * * *")]TimerInfo myTimer, TraceWriter log) //[TimerTrigger("0 0 8-18 * * FRI")]TimerInfo myTimer, TraceWriter log) + public static void Run([TimerTrigger("0/1 * * * * *")]TimerInfo myTimer, TraceWriter log) //[TimerTrigger("0 0 8-18 * * FRI")]TimerInfo myTimer, TraceWriter log) { log.Info($"C# Timer trigger function started at: {DateTime.Now}."); @@ -45,7 +46,9 @@ private static bool TheaterScheduleHasUpdated(TraceWriter log, out TheaterSchedu private static void SendNotification(TraceWriter log, TheaterSchedule currentTheaterSchedule) { - throw new NotImplementedException(); + INotificationEmailSender notificationEmailSender = new NotificationEmailSender(log); + + notificationEmailSender.SendNotificationEmail(currentTheaterSchedule); } } } \ No newline at end of file diff --git a/Melody49Notifier/Notification/NotificationEmailSender.cs b/Melody49Notifier/Notification/NotificationEmailSender.cs new file mode 100644 index 0000000..5a9985b --- /dev/null +++ b/Melody49Notifier/Notification/NotificationEmailSender.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Melody49Notifier.Models; +using Microsoft.Azure.WebJobs.Host; + +namespace Melody49Notifier.Notification +{ + public class NotificationEmailSender : INotificationEmailSender + { + public NotificationEmailSender(TraceWriter log) + { + Log = log; + } + + public TraceWriter Log { get; } + + public void SendNotificationEmail(TheaterSchedule currentTheaterSchedule) + { + throw new NotImplementedException(); + } + } +}