From 162f358bfc9a747aa27611ecb2d8ec5a27b92544 Mon Sep 17 00:00:00 2001 From: helloanil Date: Thu, 20 Jun 2024 23:01:15 +0200 Subject: [PATCH] fix: fix mentorship followup emails --- .../reminder-emails.controller.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/apps/nestjs-api/src/reminder-emails/reminder-emails.controller.ts b/apps/nestjs-api/src/reminder-emails/reminder-emails.controller.ts index 67c57d9d4..6815b070a 100644 --- a/apps/nestjs-api/src/reminder-emails/reminder-emails.controller.ts +++ b/apps/nestjs-api/src/reminder-emails/reminder-emails.controller.ts @@ -108,21 +108,23 @@ export class ReminderEmailsController { await this.reminderEmailsService.getThreeMonthsOldMentorshipMatches() if (Object.keys(threeMonthsOldMentorshipMatches).length > 0) { - threeMonthsOldMentorshipMatches.forEach(async (match) => { + Object.keys(threeMonthsOldMentorshipMatches).forEach(async (match) => { // Send reminder email to mentee await this.reminderEmailsService.sendMentorshipFollowUpReminder({ userType: UserType.MENTEE, - email: match.menteeEmail, - firstName: match.menteeFirstName, - menteeOrMentorFirstName: match.mentorFirstName, + email: threeMonthsOldMentorshipMatches[match].menteeEmail, + firstName: threeMonthsOldMentorshipMatches[match].menteeFirstName, + menteeOrMentorFirstName: + threeMonthsOldMentorshipMatches[match].mentorFirstName, }) // Send reminder email to mentor await this.reminderEmailsService.sendMentorshipFollowUpReminder({ userType: UserType.MENTOR, - email: match.mentorEmail, - firstName: match.mentorFirstName, - menteeOrMentorFirstName: match.menteeFirstName, + email: threeMonthsOldMentorshipMatches[match].mentorEmail, + firstName: threeMonthsOldMentorshipMatches[match].mentorFirstName, + menteeOrMentorFirstName: + threeMonthsOldMentorshipMatches[match].menteeFirstName, }) }) }