Skip to content

Commit 3992a6c

Browse files
committed
Interview changes from, recipients, & cc
1 parent e563947 commit 3992a6c

File tree

3 files changed

+7
-31
lines changed

3 files changed

+7
-31
lines changed

config/default.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,16 +144,18 @@ module.exports = {
144144
REQUEST_EXTENSION_EMAILS: (process.env.REQUEST_EXTENSION_EMAILS || '').split(','),
145145
// the emails address for interview invitation
146146
// INTERVIEW_INVITATION_CC_LIST may contain comma-separated list of email which is converted to array
147-
// scheduler@x.ai should be in the CC list
148-
INTERVIEW_INVITATION_CC_LIST: (process.env.INTERVIEW_INVITATION_CC_LIST || 'scheduler@x.ai').split(','),
147+
INTERVIEW_INVITATION_CC_LIST: (process.env.INTERVIEW_INVITATION_CC_LIST || '').split(','),
148+
// INTERVIEW_INVITATION_RECIPIENTS_LIST may contain comma-separated list of email which is converted to array
149+
// scheduler@x.ai should be in the RECIPIENTS list
150+
INTERVIEW_INVITATION_RECIPIENTS_LIST: (process.env.INTERVIEW_INVITATION_RECIPIENTS_LIST || 'scheduler@topcoder.com').split(','),
149151
// SendGrid email template ID for reporting issue
150152
REPORT_ISSUE_SENDGRID_TEMPLATE_ID: process.env.REPORT_ISSUE_SENDGRID_TEMPLATE_ID,
151153
// SendGrid email template ID for requesting extension
152154
REQUEST_EXTENSION_SENDGRID_TEMPLATE_ID: process.env.REQUEST_EXTENSION_SENDGRID_TEMPLATE_ID,
153155
// SendGrid email template ID for interview invitation
154156
INTERVIEW_INVITATION_SENDGRID_TEMPLATE_ID: process.env.INTERVIEW_INVITATION_SENDGRID_TEMPLATE_ID,
155157
// The sender (aka `from`) email for invitation.
156-
INTERVIEW_INVITATION_SENDER_EMAIL: process.env.INTERVIEW_INVITATION_SENDER_EMAIL || 'scheduler@topcoder.com',
158+
INTERVIEW_INVITATION_SENDER_EMAIL: process.env.INTERVIEW_INVITATION_SENDER_EMAIL || 'talent@topcoder.com',
157159
// the URL where TaaS App is hosted
158160
TAAS_APP_URL: process.env.TAAS_APP_URL || 'https://platform.topcoder-dev.com/taas/myteams',
159161
// environment variables for Payment Service

config/email_template.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ module.exports = {
9696
'interview-invitation': {
9797
from: config.INTERVIEW_INVITATION_SENDER_EMAIL,
9898
cc: config.INTERVIEW_INVITATION_CC_LIST,
99+
recipients: config.INTERVIEW_INVITATION_RECIPIENTS_LIST,
99100
sendgridTemplateId: config.INTERVIEW_INVITATION_SENDGRID_TEMPLATE_ID
100101
}
101102
}

src/eventHandlers/InterviewEventHandler.js

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,12 @@ async function sendInvitationEmail (payload) {
2020
// get job candidate user details
2121
const jobCandidate = await models.JobCandidate.findById(interview.jobCandidateId)
2222
const jobCandidateUser = await helper.getUserById(jobCandidate.userId, true)
23-
// const jobCandidateUserEmail = helper.getUserAttributeValue(jobCandidateUser, 'email')
2423
// get customer details
2524
const job = await jobCandidate.getJob()
26-
// const customerUser = await helper.getUserByExternalId(job.externalId, true)
27-
// const customerUserEmail = helper.getUserAttributeValue(customerUser, 'email')
28-
29-
// TODO: remove mock addresses & switch back to the old implementation once API gets fixed
30-
// Both emails will be undefined since TC API doesn't return attributes,
31-
// this is a workaround to skip check/condition & log the payload
32-
// it will post the event nevertheless (with mocked candidate&customer address), so you can see on the logs as kafka event
33-
// and verify the payload content
34-
const customerMockEmail = 'testcustomer@yopmail.com'
35-
const candidateMockEmail = 'testuserforemail@yopmail.com'
36-
37-
// if (jobCandidateUserEmail && customerUserEmail) {
3825
const interviewerList = interview.attendeesList
39-
// ? [customerUserEmail, ...interview.attendeesList].join(', ') // "customer@mail.com, first@attendee.com, second@attendee.com..."
40-
// : customerUserEmail
41-
? [customerMockEmail, ...interview.attendeesList].join(', ') // "customer@mail.com, first@attendee.com, second@attendee.com..."
42-
: customerMockEmail
26+
4327
teamService.sendEmail({}, {
4428
template: 'interview-invitation',
45-
recipients: [candidateMockEmail, customerMockEmail],
4629
cc: interview.attendeesList,
4730
data: {
4831
interviewType: interview.xaiTemplate,
@@ -54,16 +37,6 @@ async function sendInvitationEmail (payload) {
5437
candidateId: interview.jobCandidateId
5538
}
5639
})
57-
/* } else {
58-
// one (or both) of the emails are missing due to some reason
59-
// for e.g. some users' externalIds may be set to null or similar
60-
// log error
61-
logger.error({
62-
component: 'InterviewEventHandler',
63-
context: 'sendInvitationEmail',
64-
message: 'Couldn\'t sent invitation emails. Insufficient details.'
65-
})
66-
} */
6740
}
6841

6942
/**

0 commit comments

Comments
 (0)