diff --git a/src/lib/cron.js b/src/lib/cron.js index 5ce5c379f9..75391da763 100644 --- a/src/lib/cron.js +++ b/src/lib/cron.js @@ -44,7 +44,9 @@ const runDailyEmailJob = () => { await submittedDigest(EMAIL_DIGEST_FREQ.DAILY, DIGEST_SUBJECT_FREQ.DAILY); await approvedDigest(EMAIL_DIGEST_FREQ.DAILY, DIGEST_SUBJECT_FREQ.DAILY); await recipientApprovedDigest(EMAIL_DIGEST_FREQ.DAILY, DIGEST_SUBJECT_FREQ.DAILY); - await trainingReportTaskDueNotifications(EMAIL_DIGEST_FREQ.DAILY); + if (process.env.SEND_TRAININGREPORTTASKDUENOTIFICATION === 'true') { + await trainingReportTaskDueNotifications(EMAIL_DIGEST_FREQ.DAILY); + } } catch (error) { auditLogger.error(`Error processing Daily Email Digest job: ${error}`); logger.error(`Daily Email Digest Error: ${error}`);