@@ -20,29 +20,12 @@ async function sendInvitationEmail (payload) {
20
20
// get job candidate user details
21
21
const jobCandidate = await models . JobCandidate . findById ( interview . jobCandidateId )
22
22
const jobCandidateUser = await helper . getUserById ( jobCandidate . userId , true )
23
- // const jobCandidateUserEmail = helper.getUserAttributeValue(jobCandidateUser, 'email')
24
23
// get customer details
25
24
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) {
38
25
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
+
43
27
teamService . sendEmail ( { } , {
44
28
template : 'interview-invitation' ,
45
- recipients : [ candidateMockEmail , customerMockEmail ] ,
46
29
cc : interview . attendeesList ,
47
30
data : {
48
31
interviewType : interview . xaiTemplate ,
@@ -54,16 +37,6 @@ async function sendInvitationEmail (payload) {
54
37
candidateId : interview . jobCandidateId
55
38
}
56
39
} )
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
- } */
67
40
}
68
41
69
42
/**
0 commit comments