fix(backend): wire email delivery for verification and notifications … - #587
Open
kenzy-hue wants to merge 1 commit into
Open
fix(backend): wire email delivery for verification and notifications …#587kenzy-hue wants to merge 1 commit into
kenzy-hue wants to merge 1 commit into
Conversation
…tayLitCodes#528) - Add EmailRateLimiterService: in-memory sliding window, max 3 emails/hour/user - EmailService: add EMAIL_ENABLED dry-run mode (logs instead of sending when false), improve SMTP error logging with structured error message and stack trace - EmailSender (notifications channel): wrap all email templates in branded HTML (Vaultix gradient header, CTA button, unsubscribe footer); add plain-text footer - AuthService.sendEmailVerification: - Inject EmailRateLimiterService and enforce rate limit (TooManyRequestsException) - Check user's email notification preference and skip if opted out - Use branded HTML template with verification link, 24h expiry warning, greeting personalisation, and unsubscribe footer - Catch SMTP errors and log them — never crash the HTTP request - Save verification token before attempting send so outbox can retry - AuthModule: provide EmailRateLimiterService - EmailModule: export EmailRateLimiterService - Add 18 unit tests in auth.service.spec.ts covering: basic send, rate limiting (per-user isolation), preference opt-out, SMTP crash isolation, template content Closes StayLitCodes#528
|
@kenzy-hue Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
@kenzy-hue Kindly resolve errors |
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.
…(#528)
Closes #528