fix(email): include course name in student welcome subject (#739)
* 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 <rotimi-best@users.noreply.github.com> * fix(email): use course-only subject for student welcome email Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Rotimi Best <rotimi-best@users.noreply.github.com>
This commit is contained in:
co-authored by
Rotimi Best
Cursor Agent
parent
51f90bf450
commit
8288f157b3
@@ -0,0 +1,14 @@
|
||||
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'
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user