feat(notifications): email notification preferences (#747)
* feat(notifications): add email notification preferences Implement the email notification preferences PRD with org-level defaults and personal opt-outs enforced at the email enqueue chokepoint. - Add toggle map, profile.settings jsonb, and shouldSendEmail resolver - Extend profile and organization update APIs with emailNotifications - Pass preference context through all toggleable email send call sites - Add Settings > Notifications page with personal and org admin sections Co-authored-by: Rotimi Best <[email protected]> * feat(notifications): group email toggles into course, cohort, and enrollment sections Organize personal and org notification settings into scannable sections so users can find course- or cohort-related emails quickly. Co-authored-by: Rotimi Best <[email protected]> * fix(notifications): use Exercise instead of Quiz in toggle copy Co-authored-by: Rotimi Best <[email protected]> * fix(notifications): only mark certification email sent when enqueued Skip setMemberCertificationEmailSent when notification preferences or missing Redis prevent the completion email from being queued, so the email can still send if preferences change later. Co-authored-by: Rotimi Best <[email protected]> * fix(notifications): address PR review feedback - Add EmailPreferenceLookupCache to avoid N+1 settings lookups in batch processors and multi-recipient email enqueue paths - Replace $effect store hydration in notifications settings with onMount and explicit sync after save - Remove thin api email-preferences re-export; import from db queries - Hide tutor-only personal toggles (newStudent, newSubmission) for students Co-authored-by: Rotimi Best <[email protected]> * fix(notifications): hydrate toggles after store load and add profile settings migration - One-time store hydration via onMount plus guarded effect when profile/org load after mount, without clobbering in-progress edits - Add drizzle migration for profile.settings jsonb column Co-authored-by: Rotimi Best <[email protected]> ---------
This commit is contained in:
co-authored by
Rotimi Best
parent
14db5363e7
commit
fa060f5f6d
@@ -398,6 +398,7 @@
|
||||
},
|
||||
"tabs": {
|
||||
"profile_tab": "Profile",
|
||||
"notifications_tab": "Notifications",
|
||||
"organization_tab": "Organization",
|
||||
"landing_page_tab": "Landing Page",
|
||||
"billing_tab": "Billing",
|
||||
@@ -435,6 +436,75 @@
|
||||
"update_profile": "Update Profile",
|
||||
"logout": "Log out"
|
||||
},
|
||||
"notifications": {
|
||||
"heading": "Notifications",
|
||||
"page_title": "Notifications",
|
||||
"page_subtitle": "Choose which email notifications you receive and, as an admin, which emails your organization sends.",
|
||||
"personal": {
|
||||
"heading": "Your email preferences",
|
||||
"description": "These apply to emails sent to you across every organization you belong to. Your organization may still disable certain emails for everyone.",
|
||||
"save": "Save personal preferences",
|
||||
"save_success": "Personal notification preferences saved"
|
||||
},
|
||||
"org": {
|
||||
"heading": "Organization defaults",
|
||||
"description": "When disabled here, nobody in your organization receives that email. Members can still opt out of emails you leave enabled.",
|
||||
"save": "Save organization defaults",
|
||||
"save_success": "Organization notification defaults saved"
|
||||
},
|
||||
"sections": {
|
||||
"course": {
|
||||
"heading": "Course",
|
||||
"description": "Enrollments, submissions, lessons, announcements, and completions in your courses."
|
||||
},
|
||||
"cohort": {
|
||||
"heading": "Cohort",
|
||||
"description": "Reminders about cohort learning goals and deadlines."
|
||||
},
|
||||
"enrollment": {
|
||||
"heading": "Enrollment",
|
||||
"description": "Welcome emails sent when staff add members to courses or cohorts."
|
||||
}
|
||||
},
|
||||
"toggles": {
|
||||
"newStudent": {
|
||||
"label": "New student joins",
|
||||
"description": "Email tutors when a student enrolls in a course."
|
||||
},
|
||||
"newSubmission": {
|
||||
"label": "New submissions to grade",
|
||||
"description": "Email tutors when a student submits work that needs grading."
|
||||
},
|
||||
"gradingResult": {
|
||||
"label": "Grading results",
|
||||
"description": "Email students when their submission is graded or updated."
|
||||
},
|
||||
"newsfeed": {
|
||||
"label": "Course announcements and comments",
|
||||
"description": "Email course members about new posts and comments on the newsfeed."
|
||||
},
|
||||
"quizAssigned": {
|
||||
"label": "Exercise assigned",
|
||||
"description": "Email students when an exercise is assigned or nudged."
|
||||
},
|
||||
"cohortReminder": {
|
||||
"label": "Cohort goal reminders",
|
||||
"description": "Email students about upcoming or overdue cohort learning goals."
|
||||
},
|
||||
"session": {
|
||||
"label": "Live session reminders and updates",
|
||||
"description": "Email students before live sessions and when session details change."
|
||||
},
|
||||
"enrollmentWelcome": {
|
||||
"label": "Enrollment welcome emails",
|
||||
"description": "Send welcome emails when staff enroll students in courses or cohorts."
|
||||
},
|
||||
"courseCompletion": {
|
||||
"label": "Course completion and certificates",
|
||||
"description": "Email students when they complete a course and earn a certificate."
|
||||
}
|
||||
}
|
||||
},
|
||||
"organization": {
|
||||
"page_subtitle": "Set the name, logo, and theme students see for this organization.",
|
||||
"organization_profile": {
|
||||
|
||||
Reference in New Issue
Block a user