Table of Contents

Method RecordRecipientOutcomesAsync

Namespace
MailFathom.Application.Mail.Delivery
Assembly
MailFathom.Application.dll

RecordRecipientOutcomesAsync(IPersistenceSession, OutgoingEmailLease, OutgoingEmailId, IReadOnlyList<OutgoingRecipientOutcome>, CancellationToken)

Records what one attempt settled about the recipients it offered.

Task RecordRecipientOutcomesAsync(IPersistenceSession session, OutgoingEmailLease lease, OutgoingEmailId outgoingEmailId, IReadOnlyList<OutgoingRecipientOutcome> outcomes, CancellationToken cancellationToken)

Parameters

session IPersistenceSession

The session the write joins.

lease OutgoingEmailLease

The lease the attempt holds the record under.

outgoingEmailId OutgoingEmailId

The record the outcomes belong to.

outcomes IReadOnlyList<OutgoingRecipientOutcome>

What the attempt settled, one entry per recipient it offered.

cancellationToken CancellationToken

Cancels the write.

Returns

Task

A task that completes when the outcomes are written.

Remarks

A recipient the record already settled keeps the answer it has. Nothing offers such a recipient again, so an outcome about one is an attempt reporting what it was told rather than a fact that can have changed, and taking it would let a later transient reply undo a delivery that already happened.

Exceptions

ArgumentNullException

Thrown when session, lease, or outcomes is null.

OutgoingEmailLeaseLostException

Thrown when the record is held by a later attempt.

InvalidOperationException

Thrown when no record carries outgoingEmailId, when it has reached a terminal stage, or when an outcome names an address the record does not.