Table of Contents

Method Create

Namespace
MailFathom.Application.Emails.GetEmailContent
Assembly
MailFathom.Application.dll

Create(IReadOnlyList<StoredEmailId>, bool, bool)

Creates a request from the emails a caller named.

public static GetEmailContentRequest Create(IReadOnlyList<StoredEmailId> storedEmailIds, bool includeSanitizedHtml = false, bool includeAttachmentDetails = false)

Parameters

storedEmailIds IReadOnlyList<StoredEmailId>

The emails to read, in the order they were named.

includeSanitizedHtml bool

Whether to also produce the sanitized HTML representation of each body.

includeAttachmentDetails bool

Whether to describe each attachment rather than only count them.

Returns

GetEmailContentRequest

The validated request.

Remarks

Both refusals are the request's own invariant rather than a boundary's courtesy check, so an entrypoint added later cannot reach the use case with a list nobody counted. A caller's text is checked for length before it is parsed as well, at the boundary that holds the text.

Exceptions

ArgumentNullException

Thrown when storedEmailIds is null.

EmailContentReadCountOutOfRangeException

Thrown when no email is named, or more than MaximumEmails are.

EmailContentReadDuplicateEmailException

Thrown when the same email is named more than once.