- Added comprehensive guidelines for API route naming and structure in `ROUTE_NAMING_BEST_PRACTICES.md`. - Updated `ARCHITECHTURE.md` to reference the new best practices document. - Refactored course-related routes to follow new naming conventions, including changes to endpoint paths and validation schemas. - Removed the deprecated course clone route and integrated cloning functionality directly into the course routes. - Adjusted various API methods to ensure consistent usage of HTTP methods and parameter structures across the application.
27 lines
698 B
TypeScript
27 lines
698 B
TypeScript
import * as z from 'zod';
|
|
|
|
import { defineEmail } from '../send';
|
|
import { getDefaultTemplate } from '../templates';
|
|
|
|
export const inviteTeacherEmail = defineEmail({
|
|
id: 'inviteTeacher',
|
|
subject: 'Join us on ClassroomIO 😃',
|
|
schema: z.object({
|
|
email: z.string().email(),
|
|
orgName: z.string().min(1),
|
|
orgSiteName: z.string().min(1),
|
|
inviteLink: z.url()
|
|
}),
|
|
render: (fields) => {
|
|
const content = `
|
|
<p>Hey there,</p>
|
|
<p>You have been invited to join ${fields.orgName} on ClassroomIO 🎉🎉🎉.</p>
|
|
<div>
|
|
<a class="button" href="${fields.inviteLink}">Accept Invitation</a>
|
|
</div>
|
|
`;
|
|
|
|
return getDefaultTemplate(content);
|
|
}
|
|
});
|