From a67a95d6cc7e6d4cd5cfb4a6f9cdc827d0274c59 Mon Sep 17 00:00:00 2001 From: Carlos Quintero Date: Tue, 18 Oct 2022 12:41:34 -0500 Subject: [PATCH] add condition to send email once --- src/services/cronJobs/checkProjectVerificationStatus.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/services/cronJobs/checkProjectVerificationStatus.ts b/src/services/cronJobs/checkProjectVerificationStatus.ts index e74e35562..615f3358a 100644 --- a/src/services/cronJobs/checkProjectVerificationStatus.ts +++ b/src/services/cronJobs/checkProjectVerificationStatus.ts @@ -132,13 +132,15 @@ const remindUpdatesOrRevokeVerification = async (project: Project) => { } else if ( // After reminder at 60/75 days project.updatedAt <= maxDaysForSendingUpdateWarning && - project.updatedAt > maxDaysForSendingUpdateLastWarning + project.updatedAt > maxDaysForSendingUpdateLastWarning && + project.verificationStatus !== RevokeSteps.Warning ) { project.verificationStatus = RevokeSteps.Warning; } else if ( // First email for reminding to add an update project.updatedAt <= maxDaysForSendingUpdateReminder && - project.updatedAt > maxDaysForSendingUpdateWarning + project.updatedAt > maxDaysForSendingUpdateWarning && + project.verificationStatus !== RevokeSteps.Reminder ) { project.verificationStatus = RevokeSteps.Reminder; }