EmailAttemptRepository
Corex\Email\Delivery\EmailAttemptRepository · class · Add-ons layer
Append-only provider-event repository keyed by attempt correlation ID.
Public API
Section titled “Public API”__construct(EmailStudioStore $store)
Section titled “__construct(EmailStudioStore $store)”record(EmailAttempt $attempt): EmailAttempt
Section titled “record(EmailAttempt $attempt): EmailAttempt”findByAttemptId(string $attemptId): ?EmailAttempt
Section titled “findByAttemptId(string $attemptId): ?EmailAttempt”latest(int $limit): array
Section titled “latest(int $limit): array”latestAcceptedTest(DateTimeImmutable $since): ?EmailAttempt
Section titled “latestAcceptedTest(DateTimeImmutable $since): ?EmailAttempt”The newest test from Email Studio that the mail transport accepted since a moment, or null. Accepted means sent or opened: a captured test never left the site, and a failed one was refused. The launch checklist’s “Test email sent” asks this (spec 118, US-OVR-03). It reads the newest attempts first and stops at the first older than $since; it looks no further back than the newest {@see self::TEST_LOOKBACK}, so a site that sent more email than that since its test is told to send another.
wasSentTo(EmailAttempt $attempt, string $recipient): bool
Section titled “wasSentTo(EmailAttempt $attempt, string $recipient): bool”Whether an attempt went to this address. Asked of the repository because an attempt does not keep who it went to: it keeps the address with its middle taken out, for a person to read, and a keyed digest of it, which is what is compared here.