@@ -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 = '[email protected] ' 35- const candidateMockEmail = '[email protected] ' 36-
37- // if (jobCandidateUserEmail && customerUserEmail) {
3825 const interviewerList = interview . attendeesList
39- // ? [customerUserEmail, ...interview.attendeesList].join(', ') // "[email protected] , [email protected] , [email protected] ..." 40- // : customerUserEmail
41- ?
[ customerMockEmail , ...
interview . attendeesList ] . join ( ', ' ) // "[email protected] , [email protected] , [email protected] ..." 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