* fix(email): include course name in student welcome subject The studentCourseWelcome template used a static subject, so bulk course assignments produced identical inbox titles. Resolve the subject from courseName at send time and sanitize it like other email headers. Co-authored-by: Rotimi Best <[email protected]> * fix(email): use course-only subject for student welcome email Co-authored-by: Rotimi Best <[email protected]> --------- Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: Rotimi Best <[email protected]>
15 lines
534 B
TypeScript
15 lines
534 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { studentCourseWelcomeEmail } from '../src/emails/student-course-welcome';
|
|
|
|
describe('studentCourseWelcomeEmail', () => {
|
|
it('includes the course name in the subject', () => {
|
|
const resolveSubject = studentCourseWelcomeEmail.template.subject;
|
|
|
|
expect(typeof resolveSubject).toBe('function');
|
|
expect((resolveSubject as (fields: { courseName: string }) => string)({ courseName: 'React Basics' })).toBe(
|
|
'You have access to React Basics course'
|
|
);
|
|
});
|
|
});
|