Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Email
Overview
The Email feature packages everything required to queue, send and audit transactional emails inside the Eltheon ecosystem. It wraps SMTP configuration, an in-memory queue implementation, background service integration and convenience helpers so hosts can enqueue messages without knowing the transport details.
Capabilities
EmailManagerreadsEmailConfigfrom the global configuration store, enqueues outgoing messages via the InMemory feature and persists sent messages for auditing.EmailService : BaseServiceplugs into the Service feature so email delivery can be triggered on demand or scheduled throughServiceConfig.- Models under
v1/Modelsdescribe queue payloads (EmailItem,QueueInfo), making it straightforward to serialize and inspect deliveries. - Middleware and factories provide DI friendly access to SMTP clients and queues.
- With the Metrik feature registered, outbound sends increment
eltheon_email_send_total{transport,success}for SMTP/debug transports.
Usage
builder.Services.AddEltheonEmail(builder.Configuration, builder.Environment);
- Configure SMTP and sender information in
appsettings.json:EmailSettings(overrides legacyEmailConfigif both exist). - Inject
EmailManagerwhere emails should be enqueued and callAddEmailToQueueorSendEmailAsync. - The feature registers
EmailService, so queued emails are flushed automatically via the Service framework.
Dependencies
- Requires the InMemory feature for queue storage and the Service feature for orchestrating background processing.
- Reads file system paths from
GlobalConfig(log and email archive directories must exist).
Diagnostics
MailKit-powered SMTP transports emit structured logs via Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Email. Successful deliveries are written to DataAssets/Emails, while exhausted retries move messages into a failed-mail-* JSON for forensic analysis.