Class UserMailDrafts
- Namespace
- MailFathom.Application.Mail.Delivery.Drafts
- Assembly
- MailFathom.Application.dll
Performs the acts a user takes on one of their own drafts: keeping it, giving it up, and sending it.
public sealed class UserMailDrafts
- Inheritance
-
UserMailDrafts
- Inherited Members
Remarks
It is the user's counterpart of MailDraftBook and MailDraftPromotion, exactly as UserOutbox is the user's counterpart of the administrative outbox, and it differs from them in one thing: it says who the caller is acting for. Each act those two perform asks the author for itself, so a caller wired straight to one of them cannot reach a draft it did not write; this is where the user the caller is acting for is resolved once and handed to whichever of them the act belongs to.
A draft another user holds answers exactly as one nobody holds. There is no refusal that separates the two cases and no timing that does either, which is the rule every act on a draft follows, here and in the two types below. The comparison is against the draft's own recorded author rather than against the accounts listing, so an account unassigned since the draft was written still resolves to the person who wrote it.
Each act asks for its own grant rather than for one grant covering all three. Giving a draft up is writing it, keeping one in the user's folder reaches their mail server, and sending one puts a message in somebody else's mailbox — three different powers, and a credential holding one of them has not been granted the others.
Constructors
- UserMailDrafts(ICallerMailAccountCatalog, MailDraftBook, MailDraftPromotion, AccessAuthorization)
Performs the acts a user takes on one of their own drafts: keeping it, giving it up, and sending it.
Methods
- DiscardAsync(MailDraftId, CancellationToken)
Gives up one of this user's drafts, and takes the copies of it back out of their folder.
- SendAsync(MailDraftId, CancellationToken)
Queues one of this user's drafts for delivery, which is the only act here that reaches anybody else.