From a93a23a17332595f211292a0a8f44547d129c767 Mon Sep 17 00:00:00 2001 From: Berkan Sasmaz Date: Mon, 14 Jun 2021 10:38:33 +0300 Subject: [PATCH] Return if an email has already been sent for the notifiers --- src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs | 2 +- .../Events/EventTimingChangeNotifier.cs | 2 +- src/EventHub.BackgroundServices/Events/NewEventNotifier.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs b/src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs index 8dcda3b..e34e048 100644 --- a/src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs +++ b/src/EventHub.BackgroundServices/Events/EventReminderNotifier.cs @@ -36,7 +36,7 @@ namespace EventHub.Events public async Task NotifyAsync(Event @event) { - if (@event is null) + if (@event is null || @event.IsRemindingEmailSent) { return; } diff --git a/src/EventHub.BackgroundServices/Events/EventTimingChangeNotifier.cs b/src/EventHub.BackgroundServices/Events/EventTimingChangeNotifier.cs index cfaf080..c097c5c 100644 --- a/src/EventHub.BackgroundServices/Events/EventTimingChangeNotifier.cs +++ b/src/EventHub.BackgroundServices/Events/EventTimingChangeNotifier.cs @@ -36,7 +36,7 @@ namespace EventHub.Events public async Task NotifyAsync(Event @event) { - if (@event is null) + if (@event is null || @event.IsTimingChangeEmailSent) { return; } diff --git a/src/EventHub.BackgroundServices/Events/NewEventNotifier.cs b/src/EventHub.BackgroundServices/Events/NewEventNotifier.cs index 824563c..8939071 100644 --- a/src/EventHub.BackgroundServices/Events/NewEventNotifier.cs +++ b/src/EventHub.BackgroundServices/Events/NewEventNotifier.cs @@ -36,7 +36,7 @@ namespace EventHub.Events public async Task NotifyAsync(Event @event) { - if (@event is null) + if (@event is null || @event.IsEmailSentToMembers) { return; }