Skip to content

Commit f7ca1c2

Browse files
author
vikasrohit
authored
Merge pull request #157 from maxceem/hotfix/fix-duplicates-in-emails
[Hotfix] [Prod] fix duplicates in emails
2 parents 69a425f + ed4d286 commit f7ca1c2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

connect/connectNotificationServer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,9 +451,13 @@ const handler = (topic, message, logger, callback) => {
451451
logger.debug('filtered notifications: ', allNotifications);
452452
// now let's retrieve some additional data
453453

454+
const ids = [];
455+
logger.debug(message.initiatorUserId, 'message.initiatorUserId');
456+
if (message.initiatorUserId) {
457+
ids.push(message.initiatorUserId);
458+
}
454459
// if message has userId such messages will likely need userHandle and user full name
455460
// so let's get it
456-
const ids = [message.initiatorUserId];
457461
logger.debug(message.userId, 'message.userId');
458462
if (message.userId) {
459463
ids.push(message.userId);

connect/notificationServices/email.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function replacePlaceholders(term, data) {
2424
let ret = term;
2525
if (placeholders && placeholders.length) {
2626
_(placeholders).each(p => {
27-
const values = _.map(data, p.slice(1, -1));
27+
const values = _.uniq(_.map(data, p.slice(1, -1)));
2828
// TODO remove this code if possible.
2929
// This code appears to be not in use causing lint errors.
3030
// For now I'm commenting it, in case it contains some valuable logic.

0 commit comments

Comments
 (0)