Skip to content

[Hotfix] [Dev] fix duplicates in emails #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion connect/connectNotificationServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion connect/notificationServices/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down