diff --git a/connect/connectNotificationServer.js b/connect/connectNotificationServer.js index c315321..4815a93 100644 --- a/connect/connectNotificationServer.js +++ b/connect/connectNotificationServer.js @@ -275,6 +275,8 @@ notificationServer.setConfig({ LOG_LEVEL: 'debug' }); // logger object used to log in parent thread // the callback is function(error, userIds), where userIds is an array of user ids to receive notifications const handler = (topic, message, logger, callback) => { + logger.debug(topic, 'topic'); + logger.debug(message, 'message'); const projectId = message.projectId; if (!projectId) { return callback(new Error('Missing projectId in the event message.')); @@ -324,20 +326,22 @@ const handler = (topic, message, logger, callback) => { // 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); - return service.getUsersById(ids); } - return []; + return service.getUsersById(ids); + // return []; }).then((users) => { + logger.debug(users, 'users'); _.map(allNotifications, (notification) => { notification.version = eventConfig.version; notification.contents.projectName = project.name; notification.contents.timestamp = (new Date()).toISOString(); // if found a user then add user handle if (users.length) { - const affectedUser = _.find(users, u => u.userId === message.userId); - const initiatorUser = _.find(users, u => u.userId === message.initiatorUserId); + const affectedUser = _.find(users, u => `${u.userId}` === message.userId); + const initiatorUser = _.find(users, u => `${u.userId}` === message.initiatorUserId); if (affectedUser) { notification.contents.userHandle = affectedUser.handle; notification.contents.userFullName = `${affectedUser.firstName} ${affectedUser.lastName}`; diff --git a/emails/src/partials/invites.html b/emails/src/partials/invites.html index 8e0da62..4d2e158 100644 --- a/emails/src/partials/invites.html +++ b/emails/src/partials/invites.html @@ -30,7 +30,7 @@ - +
You are invited to join the {{projectName}} on Topcoder Connect. To join the project, please register for a Topcoder account using Register button below.You have been invited to a project by {{initiator.firstName}} {{initiator.lastName}}. To join, please register with Topcoder.