Skip to content

Marketing and communication · 2024

Email campaign engine

ASP.NET Core service for high-volume campaign delivery — template pre-rendering, SMTP connection pooling, idempotency and resilience.

  • #Backend

Key points

  • 01Retry → CircuitBreaker → Timeout resilience pipeline
  • 02Bounded concurrency with Parallel.ForEachAsync and SMTP pooling
  • 03Clean Architecture with test coverage (NSubstitute, FluentAssertions)

Context

Sending email campaigns at scale means living with unstable providers, throughput limits and the very real risk of duplicate sends. The service had to be fast, but above all reliable and predictable.

Approach

The service is built around two principles: resilience and idempotency. Templates are pre-rendered once per campaign, delivery uses SMTP connection pooling and bounded concurrency with Parallel.ForEachAsync and Channel<T>, making the most of resources without overwhelming providers.

Technical choices

  • A multi-stage Polly pipeline — Retry → CircuitBreaker → Timeout — to isolate provider failures.
  • Idempotent sends to avoid duplicates when retrying.
  • A Clean Architecture setup with automated tests (xUnit, NSubstitute, FluentAssertions).

Start a project

Have a .NET project in mind?

Whether it’s a new business system or evolving an existing one, tell me what you need: I’ll get back to you within 24–48 hours.