Method OpenAsync
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
OpenAsync(IPersistenceSession, MailAccountId, UserId, OutgoingEmailRequester, IReadOnlyList<MailDraftRecipient>, string, long, DateTimeOffset, CancellationToken)
Writes down a new draft, at the revision its first stored message is.
Task<MailDraftRecord> OpenAsync(IPersistenceSession session, MailAccountId account, UserId writtenBy, OutgoingEmailRequester author, IReadOnlyList<MailDraftRecipient> recipients, string subject, long mimeByteLength, DateTimeOffset composedAt, CancellationToken cancellationToken)
Parameters
sessionIPersistenceSessionThe session the write joins, which is the one the message is stored in.
accountMailAccountIdThe account the draft belongs to, by its generated identifier.
writtenByUserIdThe user writing it, who is the one person among the account's assigned users who reads it.
authorOutgoingEmailRequesterThe authored act that wrote it.
recipientsIReadOnlyList<MailDraftRecipient>The people it is addressed to, which may be nobody, each with where its address came from.
subjectstringThe subject line the composed message carries.
mimeByteLengthlongHow many bytes the stored message is.
composedAtDateTimeOffsetWhen it was written down.
cancellationTokenCancellationTokenCancels the write.
Returns
- Task<MailDraftRecord>
The draft as the write left it, at Composed.
Exceptions
- ArgumentNullException
Thrown when
session,author, orrecipientsis null.