diff --git a/connect/connectNotificationServer.js b/connect/connectNotificationServer.js index 4cc98be..34674e3 100644 --- a/connect/connectNotificationServer.js +++ b/connect/connectNotificationServer.js @@ -451,9 +451,13 @@ const handler = (topic, message, logger, callback) => { logger.debug('filtered notifications: ', allNotifications); // now let's retrieve some additional data + const ids = []; + logger.debug(message.initiatorUserId, 'message.initiatorUserId'); + if (message.initiatorUserId) { + ids.push(message.initiatorUserId); + } // if message has userId such messages will likely need userHandle and user full name // so let's get it - const ids = [message.initiatorUserId]; logger.debug(message.userId, 'message.userId'); if (message.userId) { ids.push(message.userId); diff --git a/connect/notificationServices/email.js b/connect/notificationServices/email.js index bc01406..3d608fc 100644 --- a/connect/notificationServices/email.js +++ b/connect/notificationServices/email.js @@ -24,7 +24,7 @@ function replacePlaceholders(term, data) { let ret = term; if (placeholders && placeholders.length) { _(placeholders).each(p => { - const values = _.map(data, p.slice(1, -1)); + const values = _.uniq(_.map(data, p.slice(1, -1))); // TODO remove this code if possible. // This code appears to be not in use causing lint errors. // For now I'm commenting it, in case it contains some valuable logic.