Class RecurringMailSubmission
- Namespace
- MailFathom.Application.Mail.Delivery.Scheduling
- Assembly
- MailFathom.Application.dll
Takes a message somebody wrote and a repetition they named, and writes both down as one declaration.
public sealed class RecurringMailSubmission
- Inheritance
-
RecurringMailSubmission
- Inherited Members
Remarks
It is the authored submission's counterpart, and it stops one step earlier: nothing is queued, because nothing is due. What it leaves is a declaration and the draft its occasions are composed from, and the recurring dispatch takes it from there — one occurrence per occasion, each an ordinary send with an ordinary record.
The message is composed here rather than at each occasion, and then composed again at each occasion from what was stored. That is not the same work done twice: composing now is what refuses a message this deployment will not send while the person who wrote it is still present to be told, and composing again later is what gives every occasion an identity and a date of its own — which is what keeps a year of Mondays a year of messages rather than one message a recipient's client folds into itself.
The repetition is parsed before anything is written, by the same syntax every other recurring dispatch in this deployment is declared in. Reusing it is deliberate: a second syntax for the same idea would be a second set of rules about daylight saving, about how short an interval may be, and about what an operator has to learn.
Stopping a declaration is here as well, because it is the same use case read backwards and because the two have to agree about what a declaration is. What it does not do is touch a message: an occurrence already written down is a message the owner asked for at a moment that has come, and stopping that one is asked for against its own record.
Constructors
- RecurringMailSubmission(IMailAccountCatalog, NamedRecipientResolver, IAuthoredEmailComposer, IRecurringSendStore, IEmailContentStore, OptimisticConcurrencyRetryPolicy, AccessAuthorization)
Initializes the use case from the accounts it serves and the two writes it commits together.
Methods
- CancelAsync(RecurringSendId, CancellationToken)
Stops a declaration from producing any further occurrence.
- DeclareAsync(RecurringMailSubmissionRequest, CancellationToken)
Declares one message to be sent again on every occasion a schedule names, or refuses it.