Skip to content

Commit a09a68b

Browse files
author
vikasrohit
authored
Merge pull request #36 from topcoder-platform/dev
Production update with notification email improvements
2 parents 42fd50d + b26752d commit a09a68b

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ workflows:
8282
- "build-dev":
8383
filters:
8484
branches:
85-
only: [dev, 'feature/discourseMigration']
85+
only: [dev, 'feature/notification-email-improvements']
8686
- "build-prod":
8787
filters:
8888
branches:

config/default.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* The configuration file.
33
*/
44
module.exports = {
5+
ENV: process.env.ENV,
56
LOG_LEVEL: process.env.LOG_LEVEL,
67
PORT: process.env.PORT,
78
authSecret: process.env.authSecret,

src/app.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ function startKafkaConsumer(handlers) {
9191
userEmail = config.DEV_MODE_EMAIL;
9292
}
9393
const recipients = [userEmail];
94-
if (notificationType === BUS_API_EVENT.EMAIL.MENTIONED_IN_POST) {
95-
recipients.push(config.MENTION_EMAIL);
94+
const cc = [];
95+
if (eventType === BUS_API_EVENT.EMAIL.MENTIONED_IN_POST) {
96+
cc.push(config.MENTION_EMAIL);
9697
}
98+
const categories = [`${config.ENV}:${eventType}`.toLowerCase()];
9799

98100
// get jwt token then encode it with base64
99101
const body = {
@@ -123,6 +125,12 @@ function startKafkaConsumer(handlers) {
123125
},
124126
recipients,
125127
replyTo,
128+
cc,
129+
from: {
130+
name: notification.contents.userHandle,
131+
email: '[email protected]',//TODO pick from config
132+
},
133+
categories,
126134
};
127135
// send event to bus api
128136
return service.postEvent({

0 commit comments

Comments
 (0)