Table of Contents

Interface IEmailMiddleware

Namespace
MailForge.Interfaces
Assembly
MailForge.dll

A unit of the framework pipeline that wraps the delivery of an EmailMessage. Middleware can inspect and mutate the message, measure and log the attempt, apply retries, and short-circuit delivery by not invoking the next handler.

public interface IEmailMiddleware

Methods

InvokeAsync(EmailDeliveryContext, NextEmailHandler)

Invoked for every message passing through the pipeline.

Task<EmailDeliveryResult> InvokeAsync(EmailDeliveryContext context, NextEmailHandler next)

Parameters

context EmailDeliveryContext

The current delivery context.

next NextEmailHandler

The next middleware (or the provider) in the pipeline.

Returns

Task<EmailDeliveryResult>

The delivery outcome.