Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 17 additions & 4 deletions src/resolvers/coordinatorResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { pushNotification } from '../utils/notification/pushNotification'
import { sendEmail } from '../utils/sendEmail'
import generalTemplate from '../utils/templates/generalTemplate'
import getOrganizationTemplate from '../utils/templates/getOrganizationTemplate'
import inviteUserTemplate from '../utils/templates/inviteUserTemplate'
import RemoveTraineeTemplate from '../utils/templates/removeTraineeTamplete'
import { Context } from './../context'
import { Document, ObjectId } from 'mongoose'
Expand Down Expand Up @@ -43,6 +42,10 @@ interface Cohort extends Document {
interface Team extends Document {
cohort: Cohort
}
const team = {
cohort: { name: 'Your Cohort Name' },
name: 'Team Name'
};

const manageStudentResolvers = {
Query: {
Expand Down Expand Up @@ -450,7 +453,9 @@ const manageStudentResolvers = {
try {
const content = getOrganizationTemplate(
org!.name,
`${process.env.FRONTEND_LINK}/login/org`
`${process.env.FRONTEND_LINK}/login/org`,
team.cohort.name,
team.name
)
await sendEmailOnMembershipActions(
role,
Expand Down Expand Up @@ -907,7 +912,9 @@ async function sendEmailOnMembershipActions(
if (program.organization._id.toString() == org?.id.toString()) {
const content = getOrganizationTemplate(
org!.name,
`${process.env.FRONTEND_LINK}/login/org`
`${process.env.FRONTEND_LINK}/login/org`,
team.cohort.name,
team.name
)
const link: any = process.env.FRONTEND_LINK + '/login/org'
await sendEmail(
Expand All @@ -934,7 +941,9 @@ async function sendEmailOnMembershipActions(
if (program.organization._id.toString() == org?.id.toString()) {
const content = getOrganizationTemplate(
org!.name,
`${process.env.FRONTEND_LINK}/login/org`
`${process.env.FRONTEND_LINK}/login/org`,
team.cohort.name,
team.name
)
const link: any = process.env.FRONTEND_LINK + '/login/org'
await sendEmail(
Expand All @@ -952,3 +961,7 @@ async function sendEmailOnMembershipActions(
}

export default manageStudentResolvers
function inviteUserTemplate(arg0: string, link: string, arg2: string) {
throw new Error('Function not implemented.')
}

4 changes: 2 additions & 2 deletions src/utils/templates/getOrganizationTemplate.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const link = process.env.FRONTEND_LINK + '/login/org'

export default function Template(orgName: string, link: string) {
export default function Template(orgName: string, link: string, cohortName: string, teamName: string) {
return /* html */ `
<table style="font-size: 16px; font-family: 'Rubik'; text-align: left">
<tbody>
Expand All @@ -10,7 +10,7 @@ export default function Template(orgName: string, link: string) {
<br />
<p style="margin-bottom: 5px">
You have been added to the <strong>${orgName}</strong> organization. You will now use it to login from here on.
You have been added to the <strong>${orgName}</strong> organization in <strong> ${cohortName}</strong>, <strong> ${teamName}</strong>. You will now use it to login from here on.
</p>
<p style="margin-bottom: 10px">
Use the button below to login into the organization.
Expand Down
Loading