Skip to content

Commit 3fe2344

Browse files
authored
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
1 parent 962b1f3 commit 3fe2344

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

src/backend/lib/db_helpers/case_manager.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface paraInputProps {
1717
export async function createPara(
1818
para: paraInputProps,
1919
db: KyselyDatabaseInstance,
20-
case_manager_id: string,
20+
case_manager_name: string,
2121
from_email: string,
2222
to_email: string,
2323
env: Env
@@ -47,7 +47,7 @@ export async function createPara(
4747
from_email,
4848
to_email,
4949
first_name,
50-
case_manager_id,
50+
case_manager_name,
5151
env
5252
);
5353
}
@@ -62,15 +62,24 @@ export async function sendInviteEmail(
6262
fromEmail: string,
6363
toEmail: string,
6464
first_name: string,
65-
caseManagerName: string,
65+
case_manager_name: string,
6666
env: Env
6767
): Promise<void> {
6868
await getTransporter(env).sendMail({
6969
from: fromEmail,
7070
to: toEmail,
71-
subject: "Para-professional email confirmation",
72-
text: "Email confirmation",
73-
html: `<p>Dear ${first_name},</p><p>Welcome to the data collection team for SFUSD.EDU!</p><p>I am writing to invite you to join our data collection efforts for our students. We are using an online platform called <strong>Project Compass</strong> to track and monitor student progress, and your participation is crucial to the success of this initiative.</p><p>To access Project Compass and begin collecting data, please follow these steps:</p><ul><li>Go to the website: (<a href="https://staging.compassiep.com/">https://staging.compassiep.com/</a>)</li> <li>Login using your provided username and password</li><li>Once logged in, navigate to the dashboard where you would see the student goals page</li></ul><p>By clicking on the <strong>data collection</strong> 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.</p><p>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.</p><p>Thank you,</p><p>${caseManagerName}<br>Case Manager</p>`,
71+
subject: `Welcome to ${case_manager_name}'s classroom`,
72+
text: `${first_name}, get set up for data collection with Compass`,
73+
html: `Hi ${first_name}! <br/>
74+
${case_manager_name} has added you as a staff member for their classroom in Compass. <br/>
75+
Compass is an all in one tool for collecting data for students’ IEP goals and empowering your classroom team to better assist students. <br/> <br/>
76+
How does Compass work? <br/>
77+
Compass will help you organize data collection for the students you work with and securely store the data you collect. <br/>
78+
${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.
79+
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. <br/><br/>
80+
Getting started <br/>
81+
To get set up with Compass, use the link below and log in with the email address you received this message at. <br/>
82+
Thank you for the key role you play in improving student outcomes!`,
7483
});
7584
return;
7685
}

src/backend/routers/case_manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export const case_manager = router({
164164
const para = await createPara(
165165
req.input,
166166
req.ctx.db,
167-
req.ctx.auth.userId,
167+
req.ctx.auth.session.user?.name ?? "",
168168
req.ctx.env.EMAIL,
169169
req.input.email,
170170
req.ctx.env

src/backend/routers/para.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ test("createPara", async (t) => {
6363
t.true(
6464
nodemailerMock.mock
6565
.getSentMail()
66-
.some((mail) => mail.subject?.includes("confirmation"))
66+
.some((mail) => mail.subject?.includes("classroom"))
6767
);
6868
});
6969

src/backend/routers/para.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const para = router({
5353
email,
5454
req.ctx.env
5555
);
56-
5756
return para;
5857

5958
// 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?

0 commit comments

Comments
 (0)