Skip to content

Commit b9e5e3e

Browse files
author
vikasrohit
authored
Merge pull request #87 from topcoder-platform/hotfix/immediate_project_invite_notification_email
Sending project invite emails immediately
2 parents 86447ae + 024257e commit b9e5e3e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

connect/notificationServices/email.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ function handler(topicName, messageJSON, notification) {
282282
eventMessage.replyTo = `${config.REPLY_EMAIL_PREFIX}+${eventMessage.data.topicId}/${token}@`
283283
+ config.REPLY_EMAIL_DOMAIN;
284284
}
285+
let requiresImmediateAttention = false;
286+
if (BUS_API_EVENT.CONNECT.MEMBER.INVITE_CREATED === notificationType) {
287+
requiresImmediateAttention = true;
288+
}
289+
285290

286291
if (messageJSON.fileName) {
287292
eventMessage.data.fileName = messageJSON.fileName;
@@ -310,7 +315,7 @@ function handler(topicName, messageJSON, notification) {
310315
}
311316
logger.debug('bundlePeriod=>', bundlePeriod);
312317

313-
if (bundlePeriod && "immediately" !== bundlePeriod) {
318+
if (bundlePeriod && "immediately" !== bundlePeriod && !requiresImmediateAttention) {
314319
if (!SCHEDULED_EVENT_PERIOD[bundlePeriod]) {
315320
throw new Error(`User's '${notification.userId}' setting for service`
316321
+ ` '${SETTINGS_EMAIL_SERVICE_ID}' option 'bundlePeriod' has unsupported value '${bundlePeriod}'.`);

0 commit comments

Comments
 (0)