import * as z from 'zod'; import { defineEmail } from '../send'; import { getDefaultTemplate } from '../templates'; import { ZEmailBranding } from '../core/branding'; 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), courseUrl: z.url(), autoEnrollUrl: z.url(), branding: ZEmailBranding }), render: (fields) => { const content = `
Hi amazing tutor,
A new student has requested to join a course you are teaching: "${fields.courseName}"
Student details
Name: ${fields.studentFullname}
Email: ${fields.studentEmail}
How to give this student access
Or automatically enroll them
Use the button below to open the course and send this student an invite in one step.
`; return getDefaultTemplate(content, fields.branding); } });