Files
classroomio/packages/email/src/emails/teacher-student-buy-request.ts
T

30 lines
879 B
TypeScript
Raw Normal View History

2026-03-09 11:18:22 +01:00
import * as z from 'zod';
import { defineEmail } from '../send';
import { getDefaultTemplate } from '../templates';
import { ZEmailBranding } from '../core/branding';
2026-03-09 11:18:22 +01:00
export const teacherStudentBuyRequestEmail = defineEmail({
id: 'teacherStudentBuyRequest',
subject: 'Request to Join Course!',
schema: z.object({
courseName: z.string().min(1),
studentEmail: z.string().email(),
studentFullname: z.string().min(1),
branding: ZEmailBranding
2026-03-09 11:18:22 +01:00
}),
render: (fields) => {
const content = `
<p>Hi amazing tutor,</p>
<p>A new student has requested to join a course you are teaching: "${fields.courseName}"</p>
<p style="font-weight: bold;">Student details</p>
<p>
Name: ${fields.studentFullname}<br />
Email: ${fields.studentEmail}
</p>
`;
return getDefaultTemplate(content, fields.branding);
2026-03-09 11:18:22 +01:00
}
});