›
›
›
  1. docs
  2. ›
  3. byrcsc/laravel-whitelabel
1.x
Browse documentationOpenClose

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Brand definitions
  • Fallback and clearing
  • Brand resolution
  • Brand repositories

Using brands

  • Blade components
  • Mail and notifications
  • Queues
  • Spatie Multitenancy

Operations

  • Manage database brands
  • Custom drivers and resolvers
  • Events and listeners
  • Cache management

Reference

  • Configuration
  • Public API
  • Console commands
  • Testing
  • Troubleshooting

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Brand definitions
  • Fallback and clearing
  • Brand resolution
  • Brand repositories

Using brands

  • Blade components
  • Mail and notifications
  • Queues
  • Spatie Multitenancy

Operations

  • Manage database brands
  • Custom drivers and resolvers
  • Events and listeners
  • Cache management

Reference

  • Configuration
  • Public API
  • Console commands
  • Testing
  • Troubleshooting

byrcsc/laravel-whitelabel · 1.x

Mail and notifications.

Apply the active brand to Laravel mail views, Markdown components, and sender addresses.

Use mail branding when messages from one application must match the active brand. Ordinary mail and notification views can read brand(). Laravel Markdown mail also receives a branded header and primary button.

Read the brand in a mail view

The helper reads the same active brand inside mailables and notifications:

<p>{{ brand('name') }}</p>
<a href="{{ brand('settings.support_url') }}">Contact support</a>

For queued delivery, opt the mailable or notification into brand context as described in Queues.

Brand Markdown mail

Markdown branding is enabled by default:

'mail' => [
    'markdown' => true,
    'override_from' => false,
],

The package inserts two mail components behind application-published mail views and ahead of Laravel's defaults:

  • The header uses the active brand's logo and name.
  • A primary button uses the brand's primary colour.

Success and error buttons keep Laravel's semantic green and red colours. If a brand has no logo or primary colour, the relevant component falls back to Laravel's output.

Storage disks often return root-relative paths. The Markdown header converts a root-relative logo into an absolute application URL so mail clients can fetch it.

Disable package Markdown styling without changing ordinary view access:

'mail' => [
    'markdown' => false,
    'override_from' => false,
],

Views already published to resources/views/vendor/mail override the package components.

Override the sender

Define sender values on each brand:

'mail' => [
    'from_name' => 'Acme Support',
    'from_address' => 'hello@acme.com',
],

Enable the override after every sending domain is authorized with the mail provider:

'mail' => [
    'markdown' => true,
    'override_from' => true,
],

The package replaces the Symfony message's From address during MessageSending. A brand without from_address, or a message sent with no active brand, keeps Laravel's configured sender.

Before you enable sender replacement, configure SPF, DKIM, and DMARC to authorize the sending service for every brand domain. The package validates address syntax, but it cannot validate DNS or provider configuration.

What to read next

  • Queues to keep the dispatch-time brand for queued mail and notifications.
  • Brand definitions for sender and logo validation.
  • Configuration for both mail switches and their defaults.
PreviousBlade componentsNextQueues
View source

On this page

  1. Read the brand in a mail view
  2. Brand Markdown mail
  3. Override the sender
  4. What to read next