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 includeAttachmentDownloadLinks = false)
Parameters
storedEmailIdsIReadOnlyList<StoredEmailId>The emails to read, in the order they were named.
includeSanitizedHtmlboolWhether to also produce the sanitized HTML representation of each body.
includeAttachmentDownloadLinksboolWhether to mint a link for each attachment rather than only describe it.
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
storedEmailIdsis null.- EmailContentReadCountOutOfRangeException
Thrown when no email is named, or more than MaximumEmails are.
- EmailContentReadDuplicateEmailException
Thrown when the same email is named more than once.