feat(mailer): pluggable email mailer with prefs, templates & failure … - #71
Merged
Merged
Conversation
…isolation Replaces token-logging password reset and no-op subscriber prefs with a real MailerModule: MailerPort interface, ConsoleMailerAdapter (dev, redacts in production-like NODE_ENV) and SmtpMailerAdapter stub, selected via MAILER_DRIVER=console|smtp. MailerService wraps sends with a timeout, in-memory outbox, and metrics stub, and never throws so mail failures can't fail the forgot-password or subscribe HTTP responses. Reset and new-subscriber flows now send HTML+text templates with escaped user-controlled fields; new-subscriber mail is gated on preferences.newSubscriber.
3 tasks
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.
closes #55
Implemented a pluggable email notification system with support for multiple mailer drivers, templated emails, user preference gating, and resilient failure handling.
Changes
MailerModulewith aMailerPortabstraction.ConsoleMailerAdapterand SMTP adapter stub with driver selection viaMAILER_DRIVER..env.examplefor mailer setup.Result
The application now supports a secure, extensible, and production-ready email architecture that is easy to extend for future notification types (e.g., tips and messages) while maintaining reliability and security.