NewWe open-sourced 50+ Laravel packages
Custom AI apps, agents and automation — Roundly ConsultingRoundly
All packages

Listen to lifecycle and recipient events to drive logging, dashboards, metrics or webhooks. They live in RoundlyConsulting\Campaigns\Events and expose their payload as public readonly properties:

EventPayloadFired when
CampaignPreparedcampaignprepare() stored the recipients and moved the campaign to Pending.
CampaignStartedcampaignstart() moved the campaign to Processing.
CampaignCompletedcampaignEvery delivery job ran (some may have failed — see progress->failed), or there was nobody to send to.
CampaignFailedcampaignEvery delivery job ran and not one delivery got through — fired instead of CampaignCompleted.
CampaignCancelledcampaigncancel() cancelled the campaign.
RecipientProcessedcampaign, recipientA recipient job delivered successfully.
RecipientFailedcampaign, recipient, errorA recipient job recorded a failure; error is the message.
use Illuminate\Support\Facades\Event;
use RoundlyConsulting\Campaigns\Events\CampaignCompleted;
use RoundlyConsulting\Campaigns\Events\RecipientFailed;

// In a service provider's boot() method:
Event::listen(function (CampaignCompleted $event): void {
    logger()->info('Campaign finished', $event->campaign->progress->toArray());
});

Event::listen(function (RecipientFailed $event): void {
    logger()->warning('Campaign delivery failed', [
        'campaign' => $event->campaign->uuid,
        'recipient' => $event->recipient->reachableAt,
        'error' => $event->error,
    ]);
});

Lifecycle events carry the campaign with progress synced from its recipients and batch at that transition, so CampaignCompleted reports the final counts — failures included. They fire only on a real status change. Recipient events fire from inside the recipient jobs — on your queue workers.

Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

More ways to support, including crypto

By donating, you agree to our donation terms.

Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.