fix: send notification of student joining course to all teachers

This commit is contained in:
Rotimi Best
2024-08-03 12:39:55 +01:00
parent 99f236b70d
commit 77dcbe078c
@@ -95,13 +95,17 @@
courseName: data.name courseName: data.name
}); });
// Send notification to teacher(s) that a student has joined the course. // Send notification to all teacher(s) that a student has joined the course.
Promise.all(
teachers.map((email) =>
triggerSendEmail(NOTIFICATION_NAME.TEACHER_STUDENT_JOINED, { triggerSendEmail(NOTIFICATION_NAME.TEACHER_STUDENT_JOINED, {
to: teachers[0], to: email,
courseName: data.name, courseName: data.name,
studentName: $profile.fullname, studentName: $profile.fullname,
studentEmail: $profile.email studentEmail: $profile.email
}); })
)
);
// go to lms // go to lms
return goto('/lms'); return goto('/lms');