feat(mail): add email notification preferences with global opt-out#550
Merged
tompscanlan merged 6 commits intomainfrom Mar 5, 2026
Merged
feat(mail): add email notification preferences with global opt-out#550tompscanlan merged 6 commits intomainfrom
tompscanlan merged 6 commits intomainfrom
Conversation
dfea0ef to
2fc39c6
Compare
…ggle - Add notifications.email to user preferences JSONB column - Check preference before sending all non-transactional emails (event announcements, group notifications, admin messages, contact notifications) - Migrate 3 legacy HBS auth templates to MJML (activation, reset-password, confirm-new-email) - Delete default.hbs layout with broken /unsubscribe link - Fix misleading "opted to receive" footer copy with factual text - Add "manage email settings" link to all notification email footers - Add preferences field to TypeORM select clauses for mail query methods - Fix pre-existing bug: return→continue in group admin notification loop Closes: om-x5pt
sendMjmlMail requires subject: string but i18n returns MaybeType<string>. Add fallback strings for activation, reset-password, and confirm-new-email.
The html-to-text library wraps URLs in brackets: `Text [URL]`. The old regex (\S+) captured the closing bracket, corrupting the JWT hash. Changed to ([^\s\]]+) to exclude brackets.
… handlers EventAnnouncementService used @Inject(REQUEST) making it request-scoped, but its @onevent handlers fire asynchronously after the HTTP request scope is destroyed. This caused handlers to silently fail in CI. Apply the same ModuleRef + ContextIdFactory pattern from CalendarInviteListener (commit fdf34f8) to dynamically resolve tenant context per handler invocation. Also update event.deleted emitter to include tenantId.
…ement The MJML template referenced `eventName` but the service passes `eventTitle` in the context, causing a ReferenceError that silently prevented update announcement emails from being sent.
49bb43a to
f25885c
Compare
No production callers found via LSP incomingCalls — only the test referenced it.
tompscanlan
added a commit
that referenced
this pull request
Mar 5, 2026
CalendarInviteListener was the only email path missing the preferences.notifications.email check added in PR #550. Users who opted out of email notifications were still receiving calendar invite emails when RSVPing to events.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
notifications.emailboolean to user preferences JSONB column (opt-out model, default true)default.hbslayout with broken/unsubscribelinkCompanion PR: OpenMeet-Team/openmeet-platform (feat/notification-preferences)
Closes: om-x5pt
Test plan