Skip to content

Commit 32b650f

Browse files
committed
add logs to email notifications scheduler
1 parent 8e895df commit 32b650f

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/services/EmailNotificationService.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ async function sendCandidatesAvailableEmails () {
120120
const jobs = _.map(jobsDao, dao => dao.dataValues)
121121

122122
const projectIds = _.uniq(_.map(jobs, job => job.projectId))
123+
124+
localLogger.debug(`[sendCandidatesAvailableEmails]: Found ${projectIds.length} project with Job Candidates awaiting for review.`)
125+
123126
// for each unique project id, send an email
124127
for (const projectId of projectIds) {
125128
const project = await getProjectWithId(projectId)
@@ -216,6 +219,8 @@ async function sendInterviewComingUpEmails () {
216219
raw: true
217220
})
218221

222+
localLogger.debug(`[sendInterviewComingUpEmails]: Found ${interviews.length} Interviews which are coming soon.`)
223+
219224
for (const interview of interviews) {
220225
// send host email
221226
const data = await getDataForInterview(interview)
@@ -288,6 +293,8 @@ async function sendInterviewCompletedEmails () {
288293
raw: true
289294
})
290295

296+
localLogger.debug(`[sendInterviewCompletedEmails]: Found ${interviews.length} Interviews which must be ended by now.`)
297+
291298
for (const interview of interviews) {
292299
if (_.isEmpty(interview.hostEmail)) {
293300
localLogger.error(`Interview id: ${interview.id} host email not present`)
@@ -330,6 +337,8 @@ async function sendPostInterviewActionEmails () {
330337
}]
331338
})
332339

340+
localLogger.debug(`[sendPostInterviewActionEmails]: Found ${completedJobCandidates.length} Job Candidates with interview completed awaiting for an action.`)
341+
333342
// get all project ids for this job candidates
334343
const jobs = await Job.findAll({
335344
where: {
@@ -410,6 +419,8 @@ async function sendResourceBookingExpirationEmails () {
410419
})
411420
const projectIds = _.uniq(_.map(expiringResourceBookings, rb => rb.projectId))
412421

422+
localLogger.debug(`[sendResourceBookingExpirationEmails]: Found ${projectIds.length} project with ${expiringResourceBookings.length} Resource Bookings expiring in less than 3 weeks.`)
423+
413424
for (const projectId of projectIds) {
414425
const project = await getProjectWithId(projectId)
415426
if (!project) { continue }

0 commit comments

Comments
 (0)