Table of Contents

Interface IEmailContentStore

Namespace
MailFathom.Application.EmailContent.Storage
Assembly
MailFathom.Application.dll

Stores raw email content outside ordinary email metadata queries.

public interface IEmailContentStore

Remarks

No storage library publishes a contract for this seam, and the store behind it is expected to move from a PostgreSQL table to object storage without a use case noticing, so the port names the operation in domain terms instead. It takes the caller's session rather than opening one of its own, which is what makes a content write commit or roll back together with the metadata row it belongs to.

Mail arriving and mail leaving are stored through the same port and are keyed differently, because they are the same kind of payload owned by two different things: a synchronized message belongs to the local row that mirrors an occurrence, and an outgoing email belongs to the record of the send it was composed for. One port is what keeps raw MIME behind one seam, so the move to object storage is one adapter's rather than two.

Methods

FindMailDraftContentAsync(MailDraftId, CancellationToken)

Reads back the raw MIME stored for the current revision of one draft.

FindOutgoingContentAsync(OutgoingEmailId, CancellationToken)

Reads back the raw MIME stored for one outgoing email, with what was recorded about it.

FindRecurringSendDraftAsync(RecurringSendId, CancellationToken)

Reads back the draft stored for one recurring send.

FindStoredContentAsync(StoredEmailId, CancellationToken)

Reads back the raw MIME stored for one locally stored email, with what was recorded about it.

SaveContentAsync(IPersistenceSession, StoredEmailId, RemoteEmailContent, CancellationToken)

Saves raw MIME content idempotently for one locally stored email.

SaveMailDraftContentAsync(IPersistenceSession, MailDraftId, ReadOnlyMemory<byte>, CancellationToken)

Saves the raw MIME one revision of a draft is held as, replacing whatever the previous revision stored.

SaveOutgoingContentAsync(IPersistenceSession, OutgoingEmailId, ReadOnlyMemory<byte>, CancellationToken)

Saves the raw MIME one outgoing email will be transmitted as, once and only once.

SaveRecurringSendDraftAsync(IPersistenceSession, RecurringSendId, ReadOnlyMemory<byte>, CancellationToken)

Saves the draft every occurrence of one recurring send is composed from, once and only once.