From 024257ede1e16f869a7e4e7c91ff53d8b44e4ee4 Mon Sep 17 00:00:00 2001 From: Vikas Agarwal Date: Fri, 1 Feb 2019 15:21:24 +0530 Subject: [PATCH] Sending project invite emails immediately --- connect/notificationServices/email.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/connect/notificationServices/email.js b/connect/notificationServices/email.js index 50aefcc..5aabd96 100644 --- a/connect/notificationServices/email.js +++ b/connect/notificationServices/email.js @@ -282,6 +282,11 @@ function handler(topicName, messageJSON, notification) { eventMessage.replyTo = `${config.REPLY_EMAIL_PREFIX}+${eventMessage.data.topicId}/${token}@` + config.REPLY_EMAIL_DOMAIN; } + let requiresImmediateAttention = false; + if (BUS_API_EVENT.CONNECT.MEMBER.INVITE_CREATED === notificationType) { + requiresImmediateAttention = true; + } + if (messageJSON.fileName) { eventMessage.data.fileName = messageJSON.fileName; @@ -310,7 +315,7 @@ function handler(topicName, messageJSON, notification) { } logger.debug('bundlePeriod=>', bundlePeriod); - if (bundlePeriod && "immediately" !== bundlePeriod) { + if (bundlePeriod && "immediately" !== bundlePeriod && !requiresImmediateAttention) { if (!SCHEDULED_EVENT_PERIOD[bundlePeriod]) { throw new Error(`User's '${notification.userId}' setting for service` + ` '${SETTINGS_EMAIL_SERVICE_ID}' option 'bundlePeriod' has unsupported value '${bundlePeriod}'.`);