Skip to content

Commit

Permalink
adding mail subjects
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmal committed Sep 18, 2024
1 parent 912e43b commit 6ece191
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 30 deletions.
26 changes: 21 additions & 5 deletions src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,9 @@ export default {
},
meeting_email: {
meeting_request_to_student: {
subject: "meeting_request_to_student",
subject: (
companyName: string
) => `Meeting Request from ${companyName}`,
body: (
firstName: string,
lastName: string,
Expand All @@ -470,7 +472,11 @@ export default {
`,
},
meeting_deleted_by_student: {
subject: "meeting_deleted_by_student",
subject: (
firstName: string,
lastName: string
)=>
`Meeting Cancelled by ${firstName} ${lastName}`,
body: (
firstName: string,
lastName: string,
Expand All @@ -484,7 +490,9 @@ export default {
`,
},
meeting_deleted_by_company: {
subject: "meeting_deleted_by_company",
subject: (
companyName: string
)=>`Meeting Cancelled by ${companyName}`,
body: (
firstName: string,
lastName: string,
Expand All @@ -499,7 +507,11 @@ export default {
`,
},
meeting_completed_to_company: {
subject: "meeting_completed_to_company",
subject: (
firstName: string,
lastName: string,
companyName: string
)=> `Meeting Confirmed – ${companyName} and ${firstName} ${lastName}`,
body: (
firstName: string,
lastName: string,
Expand All @@ -519,7 +531,11 @@ export default {
`,
},
meeting_completed_to_student: {
subject: "meeting_completed_to_student",
subject: (
firstName: string,
lastName: string,
companyName: string
)=> `Meeting Confirmed – ${companyName} and ${firstName} ${lastName}`,
body: (
firstName: string,
lastName: string,
Expand Down
41 changes: 21 additions & 20 deletions src/locales/sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,9 @@ export default {
},
meeting_email: {
meeting_request_to_student: {
subject: "meeting_request_to_student",
subject: (
companyName: string
) => `Meeting Request from ${companyName}`,
body: (
firstName: string,
lastName: string,
Expand All @@ -467,23 +469,12 @@ export default {
<p>The D-Dagen project group</p>
`,
},
company_meeting_created: {
subject: "company_meeting_created",
body: (
firstName: string,
lastName: string,
companyName: string,
)=>`
<p>Hi ${companyName}!</p>
<p>We are pleased to confirm that ${firstName} ${lastName} has accepted your meeting request</p>
<p>If any of the information above is incorrect or if you have any other questions,
do not hesitate to contact our sales team at [email protected].</p>
<p>Best regards,</p>
<p>The D-Dagen project group</p>
`,
},
meeting_deleted_by_student: {
subject: "meeting_deleted_by_student",
subject: (
firstName: string,
lastName: string
)=>
`Meeting Cancelled by ${firstName} ${lastName}`,
body: (
firstName: string,
lastName: string,
Expand All @@ -497,7 +488,9 @@ export default {
`,
},
meeting_deleted_by_company: {
subject: "meeting_deleted_by_company",
subject: (
companyName: string
)=>`Meeting Cancelled by ${companyName}`,
body: (
firstName: string,
lastName: string,
Expand All @@ -512,7 +505,11 @@ export default {
`,
},
meeting_completed_to_company: {
subject: "meeting_completed_to_company",
subject: (
firstName: string,
lastName: string,
companyName: string
)=> `Meeting Confirmed – ${companyName} and ${firstName} ${lastName}`,
body: (
firstName: string,
lastName: string,
Expand All @@ -532,7 +529,11 @@ export default {
`,
},
meeting_completed_to_student: {
subject: "meeting_completed_to_student",
subject: (
firstName: string,
lastName: string,
companyName: string
)=> `Meeting Confirmed – ${companyName} and ${firstName} ${lastName}`,
body: (
firstName: string,
lastName: string,
Expand Down
8 changes: 6 additions & 2 deletions src/server/api/routers/exhibitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,9 @@ export const exhibitorRouter = createTRPCRouter({
// send email to student that a company y (comapny) has invited student x (student) to a meeting @ilmal
sendEmail(
student.email,
t.meeting_email.meeting_request_to_student.subject,
t.meeting_email.meeting_request_to_student.subject(
exhibitor.name
),
t.meeting_email.meeting_request_to_student.body(
student.first_name,
student.last_name,
Expand Down Expand Up @@ -817,7 +819,9 @@ export const exhibitorRouter = createTRPCRouter({
// send mail to student
sendEmail(
student.email,
t.meeting_email.meeting_deleted_by_company.subject,
t.meeting_email.meeting_deleted_by_company.subject(
exhibitor.name
),
t.meeting_email.meeting_deleted_by_company.body(
student.first_name,
student.last_name,
Expand Down
17 changes: 14 additions & 3 deletions src/server/api/routers/student.ts
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,11 @@ export const studentRouter = createTRPCRouter({

sendEmail(
student.email,
t.meeting_email.meeting_completed_to_company.subject,
t.meeting_email.meeting_completed_to_company.subject(
student.firstName,
student.lastName,
exhibitor.name
),
t.meeting_email.meeting_completed_to_company.body(
student.first_name,
student.last_name,
Expand All @@ -413,7 +417,11 @@ export const studentRouter = createTRPCRouter({

sendEmail(
student.email,
t.meeting_email.meeting_completed_to_student.subject,
t.meeting_email.meeting_completed_to_student.subject(
student.firstName,
student.lastName,
exhibitor.name
),
t.meeting_email.meeting_completed_to_student.body(
student.first_name,
student.last_name,
Expand Down Expand Up @@ -487,7 +495,10 @@ export const studentRouter = createTRPCRouter({
// send mail to company
sendEmail(
student.email,
t.meeting_email.meeting_deleted_by_student.subject,
t.meeting_email.meeting_deleted_by_student.subject(
student.first_name,
student.last_name,
),
t.meeting_email.meeting_deleted_by_student.body(
student.first_name,
student.last_name,
Expand Down

0 comments on commit 6ece191

Please sign in to comment.