diff --git a/apps/dashboard/src/routes/api/email/course/teacher_student_joined/+server.js b/apps/dashboard/src/routes/api/email/course/teacher_student_joined/+server.js index 44f53e3b..36d680bb 100644 --- a/apps/dashboard/src/routes/api/email/course/teacher_student_joined/+server.js +++ b/apps/dashboard/src/routes/api/email/course/teacher_student_joined/+server.js @@ -5,11 +5,11 @@ import sendEmail from '$mail/sendEmail'; const supabase = getSupabase(); export async function POST({ request }) { - const { to, courseName } = await request.json(); + const { to, courseName, studentName, studentEmail } = await request.json(); const accessToken = request.headers.get('Authorization') || ''; console.log('/POST api/email/course/teacher_student_joined', to, courseName); - if (!to || !courseName) { + if (!to || !courseName || !studentName || !studentEmail) { return json({ success: false, message: 'Missing required fields' }, { status: 400 }); } @@ -32,10 +32,9 @@ export async function POST({ request }) { subject: `[${courseName}] You've got a new student 🎉!`, content: `
Hi amazing tutor,
-Congratulations 🎉, a new student has joined a course you are teaching: ${courseName}
+Congratulations 🎉, a new student: ${studentName} (${studentEmail}) has joined a course you are teaching: ${courseName}
We hope they have a great experience learning from the best (YOU).
-If you run into any issues, please don’t fail to reach out to us, we’d love to make your teaching - experience as easy as possible.
+If you run into any issues, please don’t fail to reach out to us, we’d love to make your teaching experience as easy as possible.
` } ]; diff --git a/apps/dashboard/src/routes/invite/s/[hash]/+page.svelte b/apps/dashboard/src/routes/invite/s/[hash]/+page.svelte index 8f65b0ff..6a206691 100644 --- a/apps/dashboard/src/routes/invite/s/[hash]/+page.svelte +++ b/apps/dashboard/src/routes/invite/s/[hash]/+page.svelte @@ -95,7 +95,9 @@ // Send notification to teacher(s) that a student has joined the course. triggerSendEmail(NOTIFICATION_NAME.TEACHER_STUDENT_JOINED, { to: teachers[0], - courseName: data.name + courseName: data.name, + studentName: $profile.fullname, + studentEmail: $profile.email }); // go to lms