Skip to content

Commit

Permalink
updates to send invite email
Browse files Browse the repository at this point in the history
  • Loading branch information
katconnors committed Oct 10, 2024
1 parent 3e31369 commit ede35a4
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions src/backend/lib/db_helpers/case_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function createPara(
case_manager_id: string,
from_email: string,
to_email: string,
env: Env
env: Env,
): Promise<user.Selectable | undefined> {
const { first_name, last_name, email } = para;

Expand Down Expand Up @@ -48,7 +48,7 @@ export async function createPara(
to_email,
first_name,
case_manager_id,
env
env,
);
}

Expand All @@ -63,14 +63,23 @@ export async function sendInviteEmail(
toEmail: string,
first_name: string,
caseManagerName: string,
env: Env
env: Env,
): Promise<void> {
await getTransporter(env).sendMail({
from: fromEmail,
to: toEmail,
subject: "Para-professional email confirmation",
text: "Email confirmation",
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>`,
subject: `Welcome to ${caseManagerName}'s classroom`,
text: `${first_name}, get set up for data collection with Compass`,
html: `Hi ${first_name}! </br>
${caseManagerName} has added you as a staff member for their classroom in Compass. </br>
Compass is an all in one tool for collecting data for students’ IEP goals and empowering your classroom team to better assist students. </br>
How does Compass work? </br>
Compass will help you organize data collection for the students you work with and securely store the data you collect. </br>
${caseManagerName} 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 ${caseManagerName} 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>
Getting started </br>
To get set up with Compass, use the link below and log in with the email address you received this message at. </br>
Thank you for the key role you play in improving student outcomes!`,
});
return;
}
Expand All @@ -83,7 +92,7 @@ export async function sendInviteEmail(
export async function assignParaToCaseManager(
para_id: string,
case_manager_id: string,
db: KyselyDatabaseInstance
db: KyselyDatabaseInstance,
): Promise<void> {
await db
.insertInto("paras_assigned_to_case_manager")
Expand All @@ -103,10 +112,10 @@ type createStudentProps = {
};

export const STUDENT_ASSIGNED_TO_YOU_ERR = new Error(
"This student is already assigned to you"
"This student is already assigned to you",
);
export const STUDENT_ALREADY_ASSIGNED_ERR = new Error(
"This student is already assigned to another case manager."
"This student is already assigned to another case manager.",
);

/**
Expand Down Expand Up @@ -155,7 +164,7 @@ export async function createAndAssignStudent({
oc
.column("email")
.doUpdateSet({ assigned_case_manager_id: userId })
.where("student.assigned_case_manager_id", "is", null)
.where("student.assigned_case_manager_id", "is", null),
)
.returningAll()
.executeTakeFirstOrThrow();
Expand Down

0 comments on commit ede35a4

Please sign in to comment.