AugusteVN.Modules.EmailCampaigns.Domain
1.0.1
See the version list below for details.
dotnet add package AugusteVN.Modules.EmailCampaigns.Domain --version 1.0.1
NuGet\Install-Package AugusteVN.Modules.EmailCampaigns.Domain -Version 1.0.1
<PackageReference Include="AugusteVN.Modules.EmailCampaigns.Domain" Version="1.0.1" />
<PackageVersion Include="AugusteVN.Modules.EmailCampaigns.Domain" Version="1.0.1" />
<PackageReference Include="AugusteVN.Modules.EmailCampaigns.Domain" />
paket add AugusteVN.Modules.EmailCampaigns.Domain --version 1.0.1
#r "nuget: AugusteVN.Modules.EmailCampaigns.Domain, 1.0.1"
#:package AugusteVN.Modules.EmailCampaigns.Domain@1.0.1
#addin nuget:?package=AugusteVN.Modules.EmailCampaigns.Domain&version=1.0.1
#tool nuget:?package=AugusteVN.Modules.EmailCampaigns.Domain&version=1.0.1
AugusteVN.Modules.EmailCampaigns.Domain
Domain entities and provider-agnostic interfaces for email campaigns — defines the IEmailCampaignsDbContext contract and all entity types used by both the EfCore and MongoDB persistence layers.
Entities
EmailCampaign (extends AuditableEntity)
| Property | Type | Default | Description |
|---|---|---|---|
Id |
Guid |
— | Primary key |
Title |
string |
— | Campaign display title |
Description |
string |
— | Campaign description |
Status |
string |
EmailCampaignStatuses.NotActive |
Campaign lifecycle status |
EmailTemplates |
IList<EmailTemplate> |
— | Navigation: templates in this campaign |
TargetEmailList |
EmailLists |
EmailLists.All |
Target subscriber lists (flags) |
StartsAt |
DateTime |
DateTime.Today |
Scheduled start date |
EmailTemplate (extends AuditableEntity)
| Property | Type | Default | Description |
|---|---|---|---|
Id |
Guid |
— | Primary key |
Subject |
string |
— | Email subject line |
BodyAsMarkdown |
string |
— | Email body in Markdown |
BodyAsHtml |
string |
— | Rendered HTML body |
SendDelayInDays |
int |
— | Days to delay after trigger event |
EmailCampaignId |
Guid? |
null |
FK to parent campaign (null for standalone) |
Status |
string |
EmailTemplateStatuses.NotActive |
Template lifecycle status |
Trigger |
string |
EmailTemplateTriggers.Subscribed |
When the template is sent |
EmailSubscriber (extends AuditableEntity)
| Property | Type | Default | Description |
|---|---|---|---|
Id |
Guid |
— | Primary key |
Email |
string |
— | Subscriber email address |
IsSubscribed |
bool |
— | Active subscription flag |
IsEmailConfirmed |
bool |
— | Email confirmation flag |
IsTester |
bool |
— | Test subscriber flag |
EmailLists |
EmailLists |
EmailLists.All |
Per-category list memberships (flags) |
SentEmail (extends AuditableEntity)
| Property | Type | Description |
|---|---|---|
Id |
Guid |
Primary key |
To |
string |
Recipient email address |
IsSuccess |
bool |
Whether the email was sent successfully |
ExceptionMessage |
string? |
Error details if send failed |
EmailTemplateId |
Guid |
FK to the template used |
EmailCampaignId |
Guid? |
FK to the campaign (if part of one) |
TraceId |
Guid |
Unique trace ID for metric correlation |
EmailJobId |
Guid? |
FK to the job (if triggered by one) |
SentEmailMetric (extends AuditableEntity)
| Property | Type | Description |
|---|---|---|
Id |
Guid |
Primary key |
SentEmailId |
Guid |
FK to the sent email |
Type |
string |
Metric type (EMAIL_READ, LINK_CLICKED, ...) |
EmailTemplateId |
Guid |
FK to the template |
EmailCampaignId |
Guid? |
FK to the campaign |
TraceId |
Guid |
Trace ID matching the sent email |
EmailJobId |
Guid? |
FK to the job |
EmailJob (extends AuditableEntity)
| Property | Type | Default | Description |
|---|---|---|---|
Id |
Guid |
— | Primary key |
TargetEmailList |
EmailLists |
— | Target subscriber lists (flags) |
StartsAt |
DateTime |
DateTime.Today |
Scheduled send date |
Status |
string |
— | Job lifecycle status |
EmailTemplateId |
Guid |
— | FK to the template to send |
EmailTemplate |
EmailTemplate |
— | Navigation: template |
PublishAsBlogPost |
bool |
— | Publish email content as a blog post |
PostType |
string? |
— | Blog post type when publishing |
IncludeSponsorSegment |
bool |
— | Include sponsor content in the email |
Interface
IEmailCampaignsDbContext
public interface IEmailCampaignsDbContext
{
IGenericRepository<EmailCampaign> EmailCampaigns { get; }
IGenericRepository<EmailTemplate> EmailTemplates { get; }
IGenericRepository<SentEmail> SentEmails { get; }
IGenericRepository<SentEmailMetric> SentEmailMetrics { get; }
IGenericRepository<EmailSubscriber> EmailSubscribers { get; }
IGenericRepository<EmailJob> EmailJobs { get; }
Task<int> SaveChangesAsync(CancellationToken cancellationToken = default);
}
Provider-agnostic contract implemented by both EmailCampaignsEfCoreDbContext and EmailCampaignsMongoDbContext.
Extension Methods
SaveSentEmailAsync
public static async Task SaveSentEmailAsync(this IEmailCampaignsDbContext context, SentEmail email)
Helper to persist a new SentEmail record.
DeactivateEmailJob
public static async Task DeactivateEmailJob(this IEmailCampaignsDbContext context, EmailJob emailJob)
Sets a job's status to NotActive and persists the change.
Dependencies
AugusteVN._Shared.ContractsAugusteVN.Database.EntitiesAugusteVN.Modules.EmailCampaigns._Shared
Installation
dotnet add package AugusteVN.Modules.EmailCampaigns.Domain
Full Documentation
See the EmailCampaigns Module README for complete documentation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- AugusteVN._Shared.Contracts (>= 1.1.0)
- AugusteVN.Database.Entities (>= 1.1.4)
- AugusteVN.Modules.EmailCampaigns._Shared (>= 1.0.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on AugusteVN.Modules.EmailCampaigns.Domain:
| Package | Downloads |
|---|---|
|
AugusteVN.Modules.EmailCampaigns.Database.EfCore
EF Core DbContext and entities for email campaigns |
|
|
AugusteVN.Modules.EmailCampaigns.Features
CQRS handlers for email campaign operations |
|
|
AugusteVN.Modules.EmailCampaigns.Database.Mongo
MongoDB persistence layer for email campaigns |
GitHub repositories
This package is not used by any popular GitHub repositories.