From 3fe23447767975ed6ded6bcdd4d3b62a65bef68d Mon Sep 17 00:00:00 2001 From: Katrina Connors <32425204+katconnors@users.noreply.github.com> Date: Tue, 22 Oct 2024 12:09:47 -0700 Subject: [PATCH] Para email update (#433) * updates to send invite email * fix line break typos * minor styling * update test for new content * prettier format * prettier format revert * revert json * accessing the admin name instead of the id * rename vars --- src/backend/lib/db_helpers/case_manager.ts | 21 +++++++++++++++------ src/backend/routers/case_manager.ts | 2 +- src/backend/routers/para.test.ts | 2 +- src/backend/routers/para.ts | 1 - 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/backend/lib/db_helpers/case_manager.ts b/src/backend/lib/db_helpers/case_manager.ts index ef78be9f..39538f74 100644 --- a/src/backend/lib/db_helpers/case_manager.ts +++ b/src/backend/lib/db_helpers/case_manager.ts @@ -17,7 +17,7 @@ interface paraInputProps { export async function createPara( para: paraInputProps, db: KyselyDatabaseInstance, - case_manager_id: string, + case_manager_name: string, from_email: string, to_email: string, env: Env @@ -47,7 +47,7 @@ export async function createPara( from_email, to_email, first_name, - case_manager_id, + case_manager_name, env ); } @@ -62,15 +62,24 @@ export async function sendInviteEmail( fromEmail: string, toEmail: string, first_name: string, - caseManagerName: string, + case_manager_name: string, env: Env ): Promise { await getTransporter(env).sendMail({ from: fromEmail, to: toEmail, - subject: "Para-professional email confirmation", - text: "Email confirmation", - html: `

Dear ${first_name},

Welcome to the data collection team for SFUSD.EDU!

I am writing to invite you to join our data collection efforts for our students. We are using an online platform called Project Compass to track and monitor student progress, and your participation is crucial to the success of this initiative.

To access Project Compass and begin collecting data, please follow these steps:

By clicking on the data collection button, you will be directed to the instructions outlining the necessary steps for data collection. Simply follow the provided instructions and enter the required data points accurately.

If you encounter any difficulties or have any questions, please feel free to reach out to me. I am here to assist you throughout the process and ensure a smooth data collection experience. Your dedication and contribution will make a meaningful impact on our students' educational journeys.

Thank you,

${caseManagerName}
Case Manager

`, + subject: `Welcome to ${case_manager_name}'s classroom`, + text: `${first_name}, get set up for data collection with Compass`, + html: `Hi ${first_name}!
+${case_manager_name} has added you as a staff member for their classroom in Compass.
+Compass is an all in one tool for collecting data for students’ IEP goals and empowering your classroom team to better assist students.

+How does Compass work?
+Compass will help you organize data collection for the students you work with and securely store the data you collect.
+${case_manager_name} will add you to data collection tasks for specific student goals. Upon logging in, you’ll see which students you’re expected to collect data for. +Instructions from ${case_manager_name} will be available with each assignment. When you’re ready to begin, you’ll be able to collect and submit data and notes directly in the app.

+Getting started
+To get set up with Compass, use the link below and log in with the email address you received this message at.
+Thank you for the key role you play in improving student outcomes!`, }); return; } diff --git a/src/backend/routers/case_manager.ts b/src/backend/routers/case_manager.ts index aaa5d91a..2a35a403 100644 --- a/src/backend/routers/case_manager.ts +++ b/src/backend/routers/case_manager.ts @@ -164,7 +164,7 @@ export const case_manager = router({ const para = await createPara( req.input, req.ctx.db, - req.ctx.auth.userId, + req.ctx.auth.session.user?.name ?? "", req.ctx.env.EMAIL, req.input.email, req.ctx.env diff --git a/src/backend/routers/para.test.ts b/src/backend/routers/para.test.ts index ecb07a97..b4a014db 100644 --- a/src/backend/routers/para.test.ts +++ b/src/backend/routers/para.test.ts @@ -63,7 +63,7 @@ test("createPara", async (t) => { t.true( nodemailerMock.mock .getSentMail() - .some((mail) => mail.subject?.includes("confirmation")) + .some((mail) => mail.subject?.includes("classroom")) ); }); diff --git a/src/backend/routers/para.ts b/src/backend/routers/para.ts index 2a5ac7e0..24396fff 100644 --- a/src/backend/routers/para.ts +++ b/src/backend/routers/para.ts @@ -53,7 +53,6 @@ export const para = router({ email, req.ctx.env ); - return para; // TODO: Logic for sending email to staff. Should email be sent everytime or only first time? Should staff be notified that they are added to a certain case manager's list?