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
contextEmailDeliveryContextThe current delivery context.
nextNextEmailHandlerThe next middleware (or the provider) in the pipeline.
Returns
- Task<EmailDeliveryResult>
The delivery outcome.