Add Email module with templates, SMTP/Log providers, and UI#63
Merged
antosubash merged 24 commits intomainfrom Apr 3, 2026
Merged
Add Email module with templates, SMTP/Log providers, and UI#63antosubash merged 24 commits intomainfrom
antosubash merged 24 commits intomainfrom
Conversation
Deploying simplemodule-website with
|
| Latest commit: |
07c5c45
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://449cf04b.simplemodule-website.pages.dev |
| Branch Preview URL: | https://claude-create-email-module-j.simplemodule-website.pages.dev |
Production email sending capability with pluggable providers (SMTP via MailKit,
Log for development). Includes template engine with {{variable}} placeholders,
email history tracking with delivery status, and Identity integration to replace
ConsoleEmailSender. Admin UI provides template management and send history views.
Covers pagination/filtering, request validation, ReplyTo support, background sending with retry via BackgroundJobs, audit logging, template variable validation with HTML escaping, and stats dashboard.
15 tasks across 7 chunks: contracts/entities, validators/template safety, pagination/stats/audit events, background jobs, endpoints, React views, and final verification.
Replaces unbounded GetAllMessagesAsync/GetAllTemplatesAsync with paginated QueryMessagesAsync/QueryTemplatesAsync, adds EmailStats/ErrorSummary/DailyCount DTOs, and adds GetEmailStatsAsync to IEmailContracts.
…velope Introduce EmailEnvelope record to encapsulate all send parameters, update IEmailProvider, SmtpEmailProvider, LogEmailProvider, and EmailService to use the new type. Add ReplyTo to message creation and stub QueryMessagesAsync/QueryTemplatesAsync/GetEmailStatsAsync on EmailService to satisfy the updated IEmailContracts interface. Update endpoints and view endpoints to use the new query methods.
Add ExtractVariables to EmailTemplateRenderer, update Render to accept isHtml for XSS-safe encoding, and validate missing template variables in SendTemplatedEmailAsync before rendering.
Replace NotImplementedException stubs in QueryMessagesAsync, QueryTemplatesAsync, and GetEmailStatsAsync with real EF Core implementations. DailyVolume grouping uses client-side evaluation for SQLite compatibility. Adds 5 new unit tests.
…endpoints - Update HistoryEndpoint and TemplatesEndpoint to accept [AsParameters] query bindings and pass result + filters to React views - Add GetStatsEndpoint (GET /stats) returning EmailStats JSON - Add DashboardEndpoint (GET /dashboard) rendering Email/Dashboard view with stats - Add Email Dashboard menu item (order 49) before Email Templates in sidebar
…ering - Set DefaultReplyTo in CreateTemplateAsync and UpdateTemplateAsync - Render email subject with isHtml: false (subjects are always plain text)
- SendEmailJob: catch MailKit-specific exceptions (SmtpCommandException, AuthenticationException, SslHandshakeException) alongside IO exceptions - QueryMessagesAsync: sort by CreatedAt (not Id) for default sort column - RetryFailedEmailsJob: batch SaveChangesAsync outside foreach loop - EmailJobRegistrationHostedService: add error handling for invalid cron - GetEmailStatsAsync: consolidate 6 DB queries down to 3 by deriving 24h/7d counts from the recentMessages in-memory list - Templates.tsx: fix cross-namespace i18n key references (History.Of → Templates.Of) - Add missing Templates.Of and Templates.FilterApply locale keys
- BackgroundJobs Detail.tsx: use log.timestamp as key instead of array index - Marketplace Browse.tsx/Detail.tsx: add aria-hidden to decorative SVGs - theme.css: suppress intentional descending specificity and !important warnings - Email en.json/keys.ts: fix Dashboard.TopErrors key collision (leaf + branch)
885c6fe to
f4352f8
Compare
Deploying simplemodule-docs with
|
| Latest commit: |
f4352f8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://59d41659.simplemodule.pages.dev |
| Branch Preview URL: | https://claude-create-email-module-j.simplemodule.pages.dev |
…ped IBackgroundJobs
The gradient-text CSS class uses -webkit-text-fill-color: transparent, which causes Playwright toBeVisible to report the heading as hidden despite being in the DOM. Use toBeAttached instead.
1 task
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
Introduces a complete Email module for SimpleModule with email sending capabilities, template management, and a web UI for managing email templates and viewing send history.
Key Changes
Core Email Service
IEmailContractswith methods for:IEmailProviderinterface with two implementations:SmtpEmailProvider: Uses MailKit for SMTP deliveryLogEmailProvider: Logs emails instead of sending (for development){{variable}}syntaxData Models & Configuration
EmailMessageandEmailTemplatewith proper EF Core configurationsEmailMessageIdandEmailTemplateIdusing VogenEmailDbContextwith schema managementEmailModuleOptionsfor configurable provider, SMTP settings, and defaultsAPI Endpoints
ViewTemplates,ManageTemplates)Web UI (React/TypeScript)
Integration
IdentityEmailSenderimplementsIEmailSender<ApplicationUser>for ASP.NET Core Identity email confirmations and password resetsEmailSentEventandEmailFailedEventfor domain eventsTesting
Notable Implementation Details
https://claude.ai/code/session_01913Uy1JyE2sgbVjqpr9FV2