Skip to content
Corex

SubmissionEmailService

Corex\Config\Submissions\SubmissionEmailService · class · Config layer

Permission-scoped submission reply, resend, and redacted delivery-log operations.

__construct(SubmissionWorkflowStore $submissions, SubmissionEmailGateway $email, SubmissionTimelineStore $timeline, SubmissionReplyStore $replies, ?SubmissionReplyDraftStore $drafts, ?SubmissionConversation $conversation, ?SubmissionEmailRecipients $recipients)

Section titled “__construct(SubmissionWorkflowStore $submissions, SubmissionEmailGateway $email, SubmissionTimelineStore $timeline, SubmissionReplyStore $replies, ?SubmissionReplyDraftStore $drafts, ?SubmissionConversation $conversation, ?SubmissionEmailRecipients $recipients)”

reply(SubmissionAccessScope $scope, int $submissionId, SubmissionReply $reply, bool $inConversation): SentReply

Section titled “reply(SubmissionAccessScope $scope, int $submissionId, SubmissionReply $reply, bool $inConversation): SentReply”

Sends a reply and keeps it with the submission, whatever happened to it: a reply that was not delivered is on record as not delivered, for whoever picks the lead up next. Where a reply is certain to be refused none is sent and none is kept: the reply box said so before anything was written (spec 106, FR-028), and this is the same answer.

sendAgain(SubmissionAccessScope $scope, int $submissionId, string $replyId): SentReply

Section titled “sendAgain(SubmissionAccessScope $scope, int $submissionId, string $replyId): SentReply”

Sends a reply that did not go another time, as it was written, and adds what happened to it (spec 106, FR-022). By anybody who may answer the submission, not only whoever wrote it: it is the second person picking the lead up who finds a reply that did not arrive. It goes in the conversation where it was to and there still is one, and as a new email otherwise. The reply is written down as being sent before the email is handed over. Two people pressing the button in the seconds a mail server takes would otherwise both pass the check above it, and the customer would have the reply twice.

preview(SubmissionAccessScope $scope, int $submissionId, SubmissionReply $reply): array

Section titled “preview(SubmissionAccessScope $scope, int $submissionId, SubmissionReply $reply): array”

The email a reply would be sent as, for the person writing it to read first. Nothing is sent and nothing is kept; the same scope and the same address as a reply.

resend(SubmissionAccessScope $scope, int $submissionId, string $attemptId): ResentEmail

Section titled “resend(SubmissionAccessScope $scope, int $submissionId, string $attemptId): ResentEmail”

Sends one of the submission’s emails again, to the people it was sent to (spec 112, FR-032a): the recipients recorded when it was sent, or, for an email sent before they were recorded, its one recipient worked out again from the flow and confirmed by the email’s attempt. Nothing is sent when they cannot be known: never a guessed recipient.

The submission’s emails as the drawer lists them: each named by what it is, and whether it can be sent again or why not (spec 112, FR-033).

log(SubmissionAccessScope $scope, int $submissionId, string $attemptId): ?array

Section titled “log(SubmissionAccessScope $scope, int $submissionId, string $attemptId): ?array”