Mail Log: Extension and action examples
Use the action functions with records and Data objects supplied by your application. They pass each argument to the package operation and return its result.
These adapters show container registration. Use the owning package registry when a contract requires contributor discovery.
Contract adapters wrap an existing implementation. Call their registration function from your service provider with that implementation; tagged contracts keep their declared tag. Resolve the backend by its concrete class before registration so the replacement contract does not resolve itself. Static contract metadata uses one backend class per adapter.
Contract Capell\MailLog\Contracts\RecipientSuppressionList
Section titled “Contract Capell\MailLog\Contracts\RecipientSuppressionList”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
final class RecipientSuppressionListAdapter implements \Capell\MailLog\Contracts\RecipientSuppressionList{ public function __construct(private readonly \Capell\MailLog\Contracts\RecipientSuppressionList $backend) {}
#[\Override] public function isSuppressed(string $address, bool $includeComplaints = true): bool { return $this->backend->isSuppressed($address, $includeComplaints); }}
function registerRecipientSuppressionListAdapter(\Capell\MailLog\Contracts\RecipientSuppressionList $backend): void{ app()->bind(RecipientSuppressionListAdapter::class, static fn (): RecipientSuppressionListAdapter => new RecipientSuppressionListAdapter($backend)); app()->bind(\Capell\MailLog\Contracts\RecipientSuppressionList::class, RecipientSuppressionListAdapter::class); app()->tag([RecipientSuppressionListAdapter::class], \Capell\MailLog\Contracts\RecipientSuppressionList::TAG);}Action alertAdminsOfHeldOutboundMessages
Section titled “Action alertAdminsOfHeldOutboundMessages”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runAlertAdminsOfHeldOutboundMessages(\Capell\MailLog\Models\OutboundMessageBreaker $breaker, \Capell\Core\Data\Messaging\OutboundMessageSourceData $source): int{ return \Capell\MailLog\Actions\AlertAdminsOfHeldOutboundMessagesAction::run($breaker, $source);}Action applyMailProviderEvent
Section titled “Action applyMailProviderEvent”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runApplyMailProviderEvent(\Capell\MailLog\Data\MailProviderEventData $event): ?\Capell\MailLog\Models\MailLogEntry{ return \Capell\MailLog\Actions\ApplyMailProviderEventAction::run($event);}Action applyPostmarkMailEvent
Section titled “Action applyPostmarkMailEvent”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runApplyPostmarkMailEvent(\Capell\MailLog\Data\PostmarkMailEventData $event): ?\Capell\MailLog\Models\MailLogEntry{ return \Capell\MailLog\Actions\ApplyPostmarkMailEventAction::run($event);}Action buildMailHealthDigest
Section titled “Action buildMailHealthDigest”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runBuildMailHealthDigest(\Carbon\CarbonImmutable $date, int $limit = 5): \Capell\MailLog\Data\MailHealthDigestData{ return \Capell\MailLog\Actions\BuildMailHealthDigestAction::run($date, $limit);}Action buildMailLogPrivacyExport
Section titled “Action buildMailLogPrivacyExport”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runBuildMailLogPrivacyExport(\Capell\Core\Data\Privacy\PrivacySubject $subject): array{ return \Capell\MailLog\Actions\BuildMailLogPrivacyExportAction::run($subject);}Action buildOutboundMessageHealth
Section titled “Action buildOutboundMessageHealth”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runBuildOutboundMessageHealth(\Carbon\CarbonImmutable $from, \Carbon\CarbonImmutable $to): array{ return \Capell\MailLog\Actions\BuildOutboundMessageHealthAction::run($from, $to);}Action captureOutboundMessage
Section titled “Action captureOutboundMessage”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runCaptureOutboundMessage(\Capell\Core\Data\Messaging\OutboundMessageSourceData $source, ?\Closure $payload = null): bool{ return \Capell\MailLog\Actions\CaptureOutboundMessageAction::run($source, $payload);}Action discardHeldOutboundMessages
Section titled “Action discardHeldOutboundMessages”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runDiscardHeldOutboundMessages(iterable $ids, ?\Illuminate\Contracts\Auth\Authenticatable $user = null, bool $includeSending = false): int{ return \Capell\MailLog\Actions\DiscardHeldOutboundMessagesAction::run($ids, $user, $includeSending);}Action eraseMailLogPrivacyData
Section titled “Action eraseMailLogPrivacyData”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runEraseMailLogPrivacyData(\Capell\Core\Data\Privacy\PrivacySubject $subject): int{ return \Capell\MailLog\Actions\EraseMailLogPrivacyDataAction::run($subject);}Action evaluateOutboundMessageHealth
Section titled “Action evaluateOutboundMessageHealth”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runEvaluateOutboundMessageHealth(?\Carbon\CarbonImmutable $now = null): array{ return \Capell\MailLog\Actions\EvaluateOutboundMessageHealthAction::run($now);}Action markMailSent
Section titled “Action markMailSent”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runMarkMailSent(\Illuminate\Mail\SentMessage $sent, ?string $mailer = null): ?\Capell\MailLog\Models\MailLogEntry{ return \Capell\MailLog\Actions\MarkMailSentAction::run($sent, $mailer);}Action markOutboundMessageSourceReviewed
Section titled “Action markOutboundMessageSourceReviewed”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runMarkOutboundMessageSourceReviewed(\Capell\MailLog\Models\OutboundMessageSource $source, ?\Illuminate\Contracts\Auth\Authenticatable $reviewer = null): \Capell\MailLog\Models\OutboundMessageSource{ return \Capell\MailLog\Actions\MarkOutboundMessageSourceReviewedAction::run($source, $reviewer);}Action markUnconfirmedMailFailed
Section titled “Action markUnconfirmedMailFailed”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runMarkUnconfirmedMailFailed(?\Throwable $throwable = null): int{ return \Capell\MailLog\Actions\MarkUnconfirmedMailFailedAction::run($throwable);}Action notifyAdminsOfNewOutboundMessage
Section titled “Action notifyAdminsOfNewOutboundMessage”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runNotifyAdminsOfNewOutboundMessage(\Capell\MailLog\Models\OutboundMessageSource $source): int{ return \Capell\MailLog\Actions\NotifyAdminsOfNewOutboundMessageAction::run($source);}Action notifyAdminsOfSourceHealth
Section titled “Action notifyAdminsOfSourceHealth”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runNotifyAdminsOfSourceHealth(\Capell\MailLog\Models\OutboundMessageSource $source, array $incidents, bool $recovered): int{ return \Capell\MailLog\Actions\NotifyAdminsOfSourceHealthAction::run($source, $incidents, $recovered);}Action purgeMailLog
Section titled “Action purgeMailLog”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runPurgeMailLog(): \Capell\MailLog\Data\MailLogPurgeResultData{ return \Capell\MailLog\Actions\PurgeMailLogAction::run();}Action recordOutgoingMail
Section titled “Action recordOutgoingMail”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runRecordOutgoingMail(\Symfony\Component\Mime\Email $message, array $data, ?\Capell\Core\Data\Messaging\OutboundMessageSourceData $source = null): ?\Capell\MailLog\Models\MailLogEntry{ return \Capell\MailLog\Actions\RecordOutgoingMailAction::run($message, $data, $source);}Action releaseHeldOutboundMessages
Section titled “Action releaseHeldOutboundMessages”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runReleaseHeldOutboundMessages(iterable $ids, ?\Illuminate\Contracts\Auth\Authenticatable $user = null): int{ return \Capell\MailLog\Actions\ReleaseHeldOutboundMessagesAction::run($ids, $user);}Action renderMailHealthDigestSection
Section titled “Action renderMailHealthDigestSection”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runRenderMailHealthDigestSection(\Carbon\CarbonImmutable $date, int $limit = 5): string{ return \Capell\MailLog\Actions\RenderMailHealthDigestSectionAction::run($date, $limit);}Action resolveMailLogSettings
Section titled “Action resolveMailLogSettings”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runResolveMailLogSettings(): \Capell\MailLog\Data\MailLogSettingsData{ return \Capell\MailLog\Actions\ResolveMailLogSettingsAction::run();}Action resolveMailLogSubjectHashes
Section titled “Action resolveMailLogSubjectHashes”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runResolveMailLogSubjectHashes(\Capell\Core\Data\Privacy\PrivacySubject $subject): array{ return \Capell\MailLog\Actions\ResolveMailLogSubjectHashesAction::run($subject);}Action resolveOutboundMessageSource
Section titled “Action resolveOutboundMessageSource”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runResolveOutboundMessageSource(array $mailData): \Capell\Core\Data\Messaging\OutboundMessageSourceData{ return \Capell\MailLog\Actions\ResolveOutboundMessageSourceAction::run($mailData);}Action setOutboundMessageBreaker
Section titled “Action setOutboundMessageBreaker”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runSetOutboundMessageBreaker(string $scope, bool $tripped, ?\Illuminate\Contracts\Auth\Authenticatable $user = null): void{ \Capell\MailLog\Actions\SetOutboundMessageBreakerAction::run($scope, $tripped, $user);}Action setOutboundMessageSourceEngagement
Section titled “Action setOutboundMessageSourceEngagement”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runSetOutboundMessageSourceEngagement(\Capell\MailLog\Models\OutboundMessageSource $source, bool $enabled): \Capell\MailLog\Models\OutboundMessageSource{ return \Capell\MailLog\Actions\SetOutboundMessageSourceEngagementAction::run($source, $enabled);}Action setOutboundMessageSourceHealthThresholds
Section titled “Action setOutboundMessageSourceHealthThresholds”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runSetOutboundMessageSourceHealthThresholds(\Capell\MailLog\Models\OutboundMessageSource $source, array $limits): \Capell\MailLog\Models\OutboundMessageSource{ return \Capell\MailLog\Actions\SetOutboundMessageSourceHealthThresholdsAction::run($source, $limits);}Action suppressMailRecipients
Section titled “Action suppressMailRecipients”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runSuppressMailRecipients(\Capell\MailLog\Models\MailLogEntry $entry, \Capell\MailLog\Data\MailProviderEventData $event, \Capell\MailLog\Enums\MailSuppressionReason $reason): int{ return \Capell\MailLog\Actions\SuppressMailRecipientsAction::run($entry, $event, $reason);}Action syncOutboundMessageCatalogue
Section titled “Action syncOutboundMessageCatalogue”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runSyncOutboundMessageCatalogue(): int{ return \Capell\MailLog\Actions\SyncOutboundMessageCatalogueAction::run();}Action updateOutboundMessageBaselines
Section titled “Action updateOutboundMessageBaselines”<?phpdeclare(strict_types=1);
namespace App\CapellExamples\MailLog;
function runUpdateOutboundMessageBaselines(?\Carbon\CarbonImmutable $at = null): int{ return \Capell\MailLog\Actions\UpdateOutboundMessageBaselinesAction::run($at);}