---
title: "Delivery channels — Campaigns for Laravel | Roundly"
description: "Deliver by HTML email with SendCampaignEmail or through Laravel notifications with SendCampaignNotification."
url: https://roundly-consulting.com/open-source/docs/campaigns-for-laravel/delivery-channels
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Campaigns for Laravel](https://roundly-consulting.com/open-source/docs/campaigns-for-laravel.md)

# Delivery channels

Each recipient is processed by the job in campaigns.process-recipient-job. Two ship with the package — both queued, both implementing Contracts\\ProcessesCampaignRecipient:

- Jobs\\SendCampaignEmail (default) — sends the campaign content as an HTML email.
- Jobs\\SendCampaignNotification — delivers through Laravel’s notification system, so the same campaign can go out by email, SMS or push.

## Email

SendCampaignEmail sends the content exactly as stored — the same HTML body for every recipient, with no per-recipient templating — using the campaign subject and sender, addressed to the recipient’s name and address. A campaign without a sender keeps the mailer’s global mail.from address and name. Success marks the recipient processed; any exception is caught and recorded as a failed recipient with its message. A cancelled batch makes the job return without sending.

## Laravel notifications

Switch the job, then point campaigns.notification at a CampaignNotification subclass and set the route channel:

```php
// config/campaigns.php
'process-recipient-job' => \RoundlyConsulting\Campaigns\Jobs\SendCampaignNotification::class,
'notification' => \App\Notifications\ProductLaunchNotification::class,
'notification-channel' => 'mail',
```

Your notification is constructed with the Campaign and the CampaignRecipient — both public readonly properties — so each channel method can render its own content:

```php
namespace App\Notifications;

use Illuminate\Notifications\Messages\MailMessage;
use RoundlyConsulting\Campaigns\Notifications\CampaignNotification;

final class ProductLaunchNotification extends CampaignNotification
{
    public function via(object $notifiable): array
    {
        return ['mail'];
    }

    public function toMail(object $notifiable): MailMessage
    {
        return (new MailMessage)
            ->subject($this->campaign->subject)
            ->greeting('Hello '.$this->recipient->name)
            ->line($this->campaign->content);
    }
}
```

The job routes an on-demand notifiable on campaigns.notification-channel (the DefaultChannel option) to the recipient’s reachableAt, then sends your notification. For SMS or push, set the channel to the one you have installed — vonage, fcm and so on — and resolve phone contacts with viaContactType(ContactType::Phone). If campaigns.notification is unset, every recipient fails with a CampaignException naming the missing config.

Need a transport that isn’t a Laravel notification? Write your own job — see Custom delivery jobs.

## 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](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## 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.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/campaigns-for-laravel.md)
