2026-03-09 11:18:22 +01:00
|
|
|
import * as z from 'zod';
|
|
|
|
|
|
|
|
|
|
import { defineEmail } from '../send';
|
|
|
|
|
import { getDefaultTemplate } from '../templates';
|
2026-06-22 05:43:48 +01:00
|
|
|
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(),
|
2026-06-22 05:43:48 +01:00
|
|
|
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>
|
|
|
|
|
`;
|
|
|
|
|
|
2026-06-22 05:43:48 +01:00
|
|
|
return getDefaultTemplate(content, fields.branding);
|
2026-03-09 11:18:22 +01:00
|
|
|
}
|
|
|
|
|
});
|