AugusteVN.Modules.EmailCampaigns.Api 1.0.7

dotnet add package AugusteVN.Modules.EmailCampaigns.Api --version 1.0.7
                    
NuGet\Install-Package AugusteVN.Modules.EmailCampaigns.Api -Version 1.0.7
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AugusteVN.Modules.EmailCampaigns.Api" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AugusteVN.Modules.EmailCampaigns.Api" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="AugusteVN.Modules.EmailCampaigns.Api" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AugusteVN.Modules.EmailCampaigns.Api --version 1.0.7
                    
#r "nuget: AugusteVN.Modules.EmailCampaigns.Api, 1.0.7"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AugusteVN.Modules.EmailCampaigns.Api@1.0.7
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AugusteVN.Modules.EmailCampaigns.Api&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=AugusteVN.Modules.EmailCampaigns.Api&version=1.0.7
                    
Install as a Cake Tool

AugusteVN.Modules.EmailCampaigns.Api

Minimal API endpoints for email campaigns, templates, subscribers, sent emails, and jobs with authorization, validation, and email metric tracking.

Part of the AugusteVN Modules collection.


Extension Methods

AddEmailCampaignsApi

Registers EmailCampaigns API services into the DI container.

public static void AddEmailCampaignsApi(this IServiceCollection services, IConfiguration configuration)

What it registers:

Service Lifetime Description
Validators from _Shared assembly Transient FluentValidation validators for all request DTOs
EmailCampaignsConfig Options Bound from configuration (ApiBaseUrl, FrontendBaseUrl)
MemoryCache Singleton In-memory cache for API responses

MapEmailCampaignsEndpoints

Maps all EmailCampaigns API endpoint groups to the route builder.

public static void MapEmailCampaignsEndpoints(this IEndpointRouteBuilder routeBuilder)

Delegates to five private mapping methods, each creating a tagged route group with an ApiExceptionFilter:

Method Route Group
MapCampaignsEndpoints() ApiRoutes.EmailCampaigns
MapEmailTemplatesEndpoints() ApiRoutes.EmailTemplates
MapSentEmailsEndpoints() ApiRoutes.SentEmails
MapEmailSubscribersEndpoints() ApiRoutes.EmailSubscribers
MapEmailJobsEndpoints() ApiRoutes.EmailJobs

API Routes

EmailCampaigns (/EmailCampaigns)

Method Route Handler Auth Description
GET /EmailCampaigns/ GetEmailCampaignsEndpoint Paginated listing of all campaigns
GET /EmailCampaigns/{id} GetEmailCampaignByIdEndpoint Single campaign by ID with nested templates
POST /EmailCampaigns/ CreateEmailCampaignEndpoint ManageEmailCampaigns Create a new campaign
PUT /EmailCampaigns/{id}/status UpdateEmailCampaignStatusEndpoint ManageEmailCampaigns Update campaign status (NotActive / InTestMode / Active)

EmailTemplates (/EmailTemplates)

Method Route Handler Auth Description
GET /EmailTemplates/ GetEmailTemplatesEndpoint Listing of all email templates
GET /EmailTemplates/{id} GetEmailTemplateByIdEndpoint Single template by ID
POST /EmailTemplates/ CreateEmailTemplateEndpoint ManageEmailCampaigns Create a new template
PUT /EmailTemplates/{id} UpdateEmailTemplateEndpoint ManageEmailCampaigns Update an existing template
PUT /EmailTemplates/{id}/status UpdateEmailTemplateStatusEndpoint ManageEmailCampaigns Update template status
POST /EmailTemplates/test TestEmailTemplateEndpoint ManageEmailCampaigns Send a test email using a template

SentEmails (/SentEmails)

Method Route Handler Auth Description
GET /SentEmails/ GetSentEmailsEndpoint Listing of sent emails with optional filters (template, campaign, job, creator)
GET /SentEmails/metrics GetSentEmailMetricsEndpoint Email metrics (reads, clicks, unsubs) with optional filters
GET /SentEmails/{encodedParams} TrackSentEmailEndpoint Tracking pixel / proxy redirect — decodes Base64 params to record metric and redirect or return a 1x1 pixel

EmailSubscribers (/EmailSubscribers)

Method Route Handler Auth Description
GET /EmailSubscribers/ GetEmailSubscribersEndpoint Listing of all subscribers
GET /EmailSubscribers/{id} GetEmailSubscriberByIdEndpoint Single subscriber by ID
GET /EmailSubscribers/count CountEmailSubscribersEndpoint Count subscribers with optional filters
PUT /EmailSubscribers/{id}/subscription UpdateEmailSubscriptionEndpoint Update subscriber list memberships (opt in/out per category)
POST /EmailSubscribers/ UpsertEmailSubscriberEndpoint Create or update a subscriber by email
DELETE /EmailSubscribers/{id} DeleteEmailSubscriberEndpoint ManageEmailSubscribers Permanently delete a subscriber

EmailJobs (/EmailJobs)

Method Route Handler Auth Description
GET /EmailJobs/ GetEmailJobsEndpoint Listing of all email jobs
POST /EmailJobs/ CreateEmailJobEndpoint ManageEmailCampaigns Create a new email job
PUT /EmailJobs/{id}/status UpdateEmailJobStatusEndpoint ManageEmailCampaigns Update job status

Endpoint Filters

Filter Usage
ApiExceptionFilter Global exception handler applied to all endpoint groups, logging errors and returning Problem responses

Tracking Mechanism

The SentEmails/{encodedParams} endpoint serves dual purposes:

  1. Tracking pixel — Returns a 1x1 transparent image to track email opens (Read metric)
  2. Link proxy — Redirects to the original URL while recording a LinkClicked metric

The encodedParams is a Base64-encoded string with the format: {traceId}/{metricType}/{encodedRedirectUrl}.


Registration

// Program.cs
builder.Services.AddEmailCampaignsApi(builder.Configuration);

app.MapEmailCampaignsEndpoints();

Installation

dotnet add package AugusteVN.Modules.EmailCampaigns.Api

Dependencies

  • AugusteVN.Modules.EmailCampaigns._Shared
  • AugusteVN.Modules.EmailCampaigns.Features
  • AugusteVN.Api.EndpointFilters
  • EmailCampaigns module overview
  • EmailCampaigns._Shared
  • EmailCampaigns.Database
  • EmailCampaigns.Features
  • EmailCampaigns.Templates
  • EmailCampaigns._Shared.Spa
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.7 82 8/9/2026
1.0.6 79 8/9/2026
1.0.2 79 8/8/2026
1.0.1 78 8/8/2026
1.0.0 79 8/8/2026