Table of Contents

Constructor AuthoredMailDrafting

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

AuthoredMailDrafting(IMailAccountCatalog, NamedRecipientResolver, IAuthoredEmailComposer, MailDraftBook, AccessAuthorization)

Takes a message somebody wrote and holds it as a draft, which is the whole of what asking to draft does.

public AuthoredMailDrafting(IMailAccountCatalog accountCatalog, NamedRecipientResolver recipientResolver, IAuthoredEmailComposer composer, MailDraftBook drafts, AccessAuthorization authorization)

Parameters

accountCatalog IMailAccountCatalog

Says which accounts this deployment serves, and therefore which one a caller may name.

recipientResolver NamedRecipientResolver

Turns the people the author named into addresses, asking the contact book for the ones named as somebody.

composer IAuthoredEmailComposer

Builds the MIME, and decides every header this system owns rather than the author.

drafts MailDraftBook

Writes the record and the message down together, and brings the drafts folder into step.

authorization AccessAuthorization

Answers whether the caller that reached this holds the grant that lets it draft.

Remarks

It is the sibling of AuthoredMailSubmission and composes the same three steps in the same order: the account a caller named is resolved against the accounts this deployment serves, the people named become addresses, and the addresses and the text become MIME. What replaces the outbox at the end is the draft book, which stores the message instead of queueing it.

Nothing here transmits, and nothing here can. The use case holds no delivery session and no factory for one, exactly as the submission does not — and unlike the submission it leaves nothing a delivery pass will ever claim. A draft leaves this deployment only when somebody asks for it to, through the promotion.

The message is composed against BeforeAnyServerHasSpoken for the reason a send is, and more plainly: a draft may never be sent at all, so there is no server to ask and the composition is held to what stays correct whatever a server would turn out to say. What that server does decide is asked again where the promotion writes the send.