You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
localLogger.debug(`[sendCandidatesAvailableEmails]: Found ${projectIds.length}project with Job Candidates awaiting for review.`)
124
+
localLogger.debug(`[sendCandidatesAvailableEmails]: Found ${projectIds.length}projects with Job Candidates awaiting for review.`)
125
125
126
126
// for each unique project id, send an email
127
+
letsentCount=0
127
128
for(constprojectIdofprojectIds){
128
129
constproject=awaitgetProjectWithId(projectId)
129
130
if(!project){continue}
@@ -175,7 +176,10 @@ async function sendCandidatesAvailableEmails () {
175
176
description: 'Candidates are available for review'
176
177
}
177
178
})
179
+
180
+
sentCount++
178
181
}
182
+
localLogger.debug(`[sendCandidatesAvailableEmails]: Sent notifications for ${sentCount} of ${projectIds.length} projects with Job Candidates awaiting for review.`)
179
183
}
180
184
181
185
/**
@@ -219,8 +223,10 @@ async function sendInterviewComingUpEmails () {
219
223
raw: true
220
224
})
221
225
222
-
localLogger.debug(`[sendInterviewComingUpEmails]: Found ${interviews.length}Interviews which are coming soon.`)
226
+
localLogger.debug(`[sendInterviewComingUpEmails]: Found ${interviews.length}interviews which are coming soon.`)
223
227
228
+
letsentHostCount=0
229
+
letsentGuestCount=0
224
230
for(constinterviewofinterviews){
225
231
// send host email
226
232
constdata=awaitgetDataForInterview(interview)
@@ -238,6 +244,8 @@ async function sendInterviewComingUpEmails () {
238
244
description: 'Interview Coming Up'
239
245
}
240
246
})
247
+
248
+
sentHostCount++
241
249
}else{
242
250
localLogger.error(`Interview id: ${interview.id} host email not present`,'sendInterviewComingUpEmails')
243
251
}
@@ -255,10 +263,14 @@ async function sendInterviewComingUpEmails () {
255
263
description: 'Interview Coming Up'
256
264
}
257
265
})
266
+
267
+
sentGuestCount++
258
268
}else{
259
269
localLogger.error(`Interview id: ${interview.id} guest emails not present`,'sendInterviewComingUpEmails')
260
270
}
261
271
}
272
+
273
+
localLogger.debug(`[sendInterviewComingUpEmails]: Sent notifications for ${sentHostCount} hosts and ${sentGuestCount} guest of ${interviews.length} interviews which are coming soon.`)
262
274
}
263
275
264
276
/**
@@ -293,8 +305,9 @@ async function sendInterviewCompletedEmails () {
293
305
raw: true
294
306
})
295
307
296
-
localLogger.debug(`[sendInterviewCompletedEmails]: Found ${interviews.length}Interviews which must be ended by now.`)
308
+
localLogger.debug(`[sendInterviewCompletedEmails]: Found ${interviews.length}interviews which must be ended by now.`)
297
309
310
+
letsentCount=0
298
311
for(constinterviewofinterviews){
299
312
if(_.isEmpty(interview.hostEmail)){
300
313
localLogger.error(`Interview id: ${interview.id} host email not present`)
@@ -315,7 +328,11 @@ async function sendInterviewCompletedEmails () {
315
328
description: 'Interview Completed'
316
329
}
317
330
})
331
+
332
+
sentCount++
318
333
}
334
+
335
+
localLogger.debug(`[sendInterviewCompletedEmails]: Sent notifications for ${sentCount} of ${interviews.length} interviews which must be ended by now.`)
319
336
}
320
337
321
338
/**
@@ -337,8 +354,6 @@ async function sendPostInterviewActionEmails () {
337
354
}]
338
355
})
339
356
340
-
localLogger.debug(`[sendPostInterviewActionEmails]: Found ${completedJobCandidates.length} Job Candidates with interview completed awaiting for an action.`)
341
-
342
357
// get all project ids for this job candidates
343
358
constjobs=awaitJob.findAll({
344
359
where: {
@@ -350,6 +365,10 @@ async function sendPostInterviewActionEmails () {
localLogger.debug(`[sendPostInterviewActionEmails]: Found ${projectIds.length} projects with ${completedJobCandidates.length} Job Candidates with interview completed awaiting for an action.`)
370
+
371
+
letsentCount=0
353
372
for(constprojectIdofprojectIds){
354
373
constproject=awaitgetProjectWithId(projectId)
355
374
if(!project){continue}
@@ -383,7 +402,11 @@ async function sendPostInterviewActionEmails () {
localLogger.debug(`[sendPostInterviewActionEmails]: Sent notifications for ${sentCount} of ${projectIds.length} projects with Job Candidates with interview completed awaiting for an action.`)
387
410
}
388
411
389
412
/**
@@ -419,8 +442,9 @@ async function sendResourceBookingExpirationEmails () {
localLogger.debug(`[sendResourceBookingExpirationEmails]: Found ${projectIds.length}project with ${expiringResourceBookings.length} Resource Bookings expiring in less than 3 weeks.`)
445
+
localLogger.debug(`[sendResourceBookingExpirationEmails]: Found ${projectIds.length}projects with ${expiringResourceBookings.length} Resource Bookings expiring in less than 3 weeks.`)
423
446
447
+
letsentCount=0
424
448
for(constprojectIdofprojectIds){
425
449
constproject=awaitgetProjectWithId(projectId)
426
450
if(!project){continue}
@@ -458,7 +482,11 @@ async function sendResourceBookingExpirationEmails () {
localLogger.debug(`[sendResourceBookingExpirationEmails]: Sent notifications for ${sentCount} of ${projectIds.length} projects with Resource Bookings expiring in less than 3 weeks.`)
0 commit comments