From 376961f30d9aadc5aa7905281f8de94f1acb4940 Mon Sep 17 00:00:00 2001 From: Carina Wollendorfer <30310907+CarinaWolli@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:02:54 -0500 Subject: [PATCH] fix: don't send reassingment email to attendee for past events (#18173) Co-authored-by: CarinaWolli --- .../features/ee/round-robin/roundRobinManualReassignment.ts | 2 +- packages/features/ee/round-robin/roundRobinReassignment.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/features/ee/round-robin/roundRobinManualReassignment.ts b/packages/features/ee/round-robin/roundRobinManualReassignment.ts index d1ef0efbd2..363c4edba7 100644 --- a/packages/features/ee/round-robin/roundRobinManualReassignment.ts +++ b/packages/features/ee/round-robin/roundRobinManualReassignment.ts @@ -346,7 +346,7 @@ export const roundRobinManualReassignment = async ({ } if (hasOrganizerChanged) { - if (emailsEnabled) { + if (emailsEnabled && dayjs(evt.startTime).isAfter(dayjs())) { // send email with event updates to attendees await sendRoundRobinUpdatedEmailsAndSMS({ calEvent: evtWithoutCancellationReason, diff --git a/packages/features/ee/round-robin/roundRobinReassignment.ts b/packages/features/ee/round-robin/roundRobinReassignment.ts index c832f4bb69..f3190d9c42 100644 --- a/packages/features/ee/round-robin/roundRobinReassignment.ts +++ b/packages/features/ee/round-robin/roundRobinReassignment.ts @@ -396,7 +396,7 @@ export const roundRobinReassignment = async ({ // Handle changing workflows with organizer if (hasOrganizerChanged) { - if (emailsEnabled) { + if (emailsEnabled && dayjs(evt.startTime).isAfter(dayjs())) { // send email with event updates to attendees await sendRoundRobinUpdatedEmailsAndSMS({ calEvent: evtWithoutCancellationReason,