Feat/110 email service module#121
Merged
memplethee-lab merged 15 commits intoJul 24, 2026
Merged
Conversation
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
…ue management, and multi-provider support (Issue SourceXXL#110)
- email-queue.service.ts: explicit Map generic type, refactor update calls with typed metadata object to avoid QueryDeepPartialEntity mismatch - email.service.spec.ts: add missing getPendingEmailCount to mock factory, use 'as any' cast for mock access on queueService - global-exception.filter.ts: remove broken SeverityLevel import from @sentry/core (removed in v10), inline string literal type instead
9 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 #110
Overview
Implements a comprehensive email service module that handles sending transactional and notification emails with template support, async queue-based delivery, multiple provider adapters, and delivery tracking.
Architecture
src/email/
├── dto/send-email.dto.ts # Validated DTOs (SendEmailDto, CreateTemplateDto, SendBulkEmailDto)
├── entities/email-log.entity.ts # TypeORM entity for delivery tracking
├── interfaces/email-provider.interface.ts # Provider contract
├── providers/
│ ├── smtp-email.provider.ts # SMTP via nodemailer (primary)
│ ├── sendgrid-email.provider.ts # SendGrid adapter (stub)
│ └── ses-email.provider.ts # AWS SES adapter (stub)
├── services/
│ ├── template-engine.service.ts # {{variable}} substitution with XSS escaping
│ ├── email-queue.service.ts # Bull queue with exponential backoff retry
│ └── email-processor.service.ts # Bull job processor
├── email.service.ts # Orchestrator (send, bulk, retry, unsubscribe)
├── email.controller.ts # REST endpoints with Swagger docs
├── email.module.ts # NestJS module wiring
└── email.service.spec.ts # Unit tests
Features Implemented
{{variable}}substitution and HTML-escaping (XSS protection)email_logstable: queued/sending/sent/failed/bounced)