›
byrcsc/laravel-whitelabel · 1.x
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.
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.
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:
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.
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.