Skip to content

Commit e8ab590

Browse files
author
vikasrohit
authored
Merge pull request #194 from maxceem/hotfix/email-user-photo-size
[HOTFIX] [DEV] email user photo size, part 2
2 parents 12cef6f + eb38194 commit e8ab590

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

connect/notificationServices/email.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ function handler(topicName, messageJSON, notification) {
237237
projectId: messageJSON.projectId,
238238
authorHandle: notification.contents.userHandle,
239239
authorFullName: notification.contents.userFullName,
240-
photoURL: `${config.TC_CDN_URL}/avatar/${encodeURIComponent(notification.contents.photoURL)}`
241-
+ `?size=${EMAIL_USER_PHOTO_SIZE}`,
242240
type: notificationType,
243241
emailToAffectedUser: notification.contents.userEmail === userEmail,
244242
},
@@ -252,6 +250,9 @@ function handler(topicName, messageJSON, notification) {
252250
};
253251
eventMessage.data[eventMessage.data.type] = true;
254252
_.assign(eventMessage.data, notification.contents);
253+
// set `photoURL` after we already applied `notification.contents`, so `photoURL` doesn't get overwritten
254+
eventMessage.data.photoURL = `${config.TC_CDN_URL}/avatar/${encodeURIComponent(notification.contents.photoURL)}`
255+
+ `?size=${EMAIL_USER_PHOTO_SIZE}`;
255256

256257
// message service may return tags
257258
// to understand if post notification is regarding phases or no, we will try to get phaseId from the tags

0 commit comments

Comments
 (0)