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 teacherCourseWelcomeEmail = defineEmail({
|
|
|
|
|
id: 'teacherCourseWelcome',
|
|
|
|
|
subject: 'You have been invited to a course!',
|
|
|
|
|
schema: z.object({
|
|
|
|
|
name: z.string().min(1),
|
|
|
|
|
orgName: z.string().min(1),
|
|
|
|
|
courseName: z.string().min(1),
|
2026-06-22 05:43:48 +01:00
|
|
|
inviteLink: z.url(),
|
|
|
|
|
branding: ZEmailBranding
|
2026-03-09 11:18:22 +01:00
|
|
|
}),
|
|
|
|
|
render: (fields) => {
|
|
|
|
|
const content = `
|
|
|
|
|
<p>Hey ${fields.name},</p>
|
|
|
|
|
<p>You have been given access to teach a course by ${fields.orgName}</p>
|
|
|
|
|
<p>The course is titled: ${fields.courseName}</p>
|
|
|
|
|
<div>
|
|
|
|
|
<a class="button" href="${fields.inviteLink}">Open Dashboard</a>
|
|
|
|
|
</div>
|
|
|
|
|
`;
|
|
|
|
|
|
2026-06-22 05:43:48 +01:00
|
|
|
return getDefaultTemplate(content, fields.branding);
|
2026-03-09 11:18:22 +01:00
|
|
|
}
|
|
|
|
|
});
|