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

  1. Open the course: ${fields.courseUrl}
  2. Click People on the sidebar
  3. Click Add
  4. Under Invite new students, enter ${fields.studentEmail}
  5. Click Invite Students

Or automatically enroll them

Use the button below to open the course and send this student an invite in one step.

Auto Enroll Student
`; return getDefaultTemplate(content, fields.branding); } });