feat: enhance API and middleware functionality: add public API routes, implement program and course member checks, and improve rate limiting for invite acceptance. Update OpenAPI spec generation to focus on public API endpoints and add new middleware for automation key scopes. Include new documentation for lesson AI features and public API tests.
This commit is contained in:
@@ -20,6 +20,7 @@ export * from './teacher-student-buy-request';
|
||||
export * from './student-prove-payment';
|
||||
export * from './teacher-course-welcome';
|
||||
export * from './student-org-invite';
|
||||
export * from './student-program-welcome';
|
||||
|
||||
import type { newsfeedCommentEmail, newsfeedPostEmail } from './newsfeed';
|
||||
|
||||
@@ -32,6 +33,7 @@ import type { studentCourseCompletionEmail } from './student-course-completion';
|
||||
import type { studentCourseWelcomeEmail } from './student-course-welcome';
|
||||
import type { studentProvePaymentEmail } from './student-prove-payment';
|
||||
import type { studentOrgInviteEmail } from './student-org-invite';
|
||||
import type { studentProgramWelcomeEmail } from './student-program-welcome';
|
||||
import type { teacherCourseWelcomeEmail } from './teacher-course-welcome';
|
||||
import type { teacherStudentBuyRequestEmail } from './teacher-student-buy-request';
|
||||
import type { teacherStudentJoinedEmail } from './teacher-student-joined';
|
||||
@@ -60,4 +62,5 @@ export type EmailSchemas = {
|
||||
studentProvePayment: typeof studentProvePaymentEmail.template.schema;
|
||||
teacherCourseWelcome: typeof teacherCourseWelcomeEmail.template.schema;
|
||||
studentOrgInvite: typeof studentOrgInviteEmail.template.schema;
|
||||
studentProgramWelcome: typeof studentProgramWelcomeEmail.template.schema;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import * as z from 'zod';
|
||||
|
||||
import { defineEmail } from '../send';
|
||||
import { getDefaultTemplate } from '../templates';
|
||||
|
||||
export const studentProgramWelcomeEmail = defineEmail({
|
||||
id: 'studentProgramWelcome',
|
||||
subject: 'You have access to a program — sign in to get started',
|
||||
schema: z.object({
|
||||
orgName: z.string().min(1),
|
||||
programName: z.string().min(1),
|
||||
loginUrl: z.string().min(1)
|
||||
}),
|
||||
render: (fields) => {
|
||||
const content = `
|
||||
<p>Hi there,</p>
|
||||
<p>You now have access to <strong>${fields.programName}</strong> in <strong>${fields.orgName}</strong>.</p>
|
||||
<p><a href="${fields.loginUrl}">Sign in to ClassroomIO</a> to open the program and get started.</p>
|
||||
<p>If you run into any issues, reach out to your instructor(s).</p>
|
||||
<p>Cheers,</p>
|
||||
<p>${fields.orgName}</p>
|
||||
`;
|
||||
|
||||
return getDefaultTemplate(content);
|
||||
}
|
||||
});
|
||||
@@ -177,11 +177,11 @@ export const getDefaultTemplate = (content: string): string =>
|
||||
</table>
|
||||
<p style="padding-top: 8px; line-height: initial">
|
||||
ClassroomIO ${new Date().getFullYear()}. All rights reserved.<br />
|
||||
<a style="text-decoration: none" href="https://app.enzuzo.com/policies/tos/958fc978-5477-11ee-a03b-7b111830c594"
|
||||
<a style="text-decoration: none" href="https://classroomio.com/tos"
|
||||
target="_blank">Terms</a>
|
||||
|
|
||||
<a style="text-decoration: none"
|
||||
href="https://app.enzuzo.com/policies/privacy/958fc978-5477-11ee-a03b-7b111830c594" target="_blank">Privacy
|
||||
href="https://classroomio.com/privacy" target="_blank">Privacy
|
||||
Policy</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -10,6 +10,7 @@ export const EMAIL_IDS = [
|
||||
'studentCourseCompletion',
|
||||
'studentCourseWelcome',
|
||||
'studentOrgInvite',
|
||||
'studentProgramWelcome',
|
||||
'studentProvePayment',
|
||||
'teacherCourseWelcome',
|
||||
'teacherStudentBuyRequest',
|
||||
|
||||
Reference in New Issue
Block a user