From 323fd1dd5c3cac980632f973bef1c253dcc1fa42 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Mon, 8 Jun 2026 20:11:43 +0000 Subject: [PATCH] Add app-specific mail branding and sidebar Support links. Co-authored-by: Cursor --- config/mail_brands.php | 123 ++++++++++++++++++ .../notifications/event-programme.blade.php | 8 ++ .../views/mail/notifications/layout.blade.php | 18 +-- .../transfer-owner-grace.blade.php | 8 ++ .../transfer-recipient.blade.php | 6 +- .../mail/partials/brand-footer.blade.php | 20 +++ .../mail/partials/brand-header.blade.php | 7 + .../views/partials/sidebar-support.blade.php | 23 ++++ resources/views/partials/sidebar.blade.php | 1 + 9 files changed, 201 insertions(+), 13 deletions(-) create mode 100644 config/mail_brands.php create mode 100644 resources/views/mail/partials/brand-footer.blade.php create mode 100644 resources/views/mail/partials/brand-header.blade.php create mode 100644 resources/views/partials/sidebar-support.blade.php diff --git a/config/mail_brands.php b/config/mail_brands.php new file mode 100644 index 0000000..c0fa4a7 --- /dev/null +++ b/config/mail_brands.php @@ -0,0 +1,123 @@ + env( + 'LADILL_ACCOUNT_URL', + 'https://'.env('ACCOUNT_DOMAIN', 'account.'.$platformHost) + ), + + 'brands' => [ + 'ladill' => [ + 'name' => 'Ladill', + 'logo' => 'ladill-logo-white.png', + 'logo_class' => 'email-logo', + 'app_url' => env('APP_URL', 'https://ladill.com'), + 'footer_account' => 'an account with Ladill', + 'dashboard_path' => '/dashboard', + 'support_path' => '/support', + 'home_label' => 'ladill.com', + ], + 'hosting' => [ + 'name' => 'Ladill Hosting', + 'logo' => 'ladillhosting-logo-email.png', + 'logo_class' => 'email-logo', + 'app_url' => env('LADILL_HOSTING_APP_URL', 'https://hosting.ladill.com'), + 'footer_account' => 'a Ladill Hosting account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'hosting.ladill.com', + ], + 'domains' => [ + 'name' => 'Ladill Domains', + 'logo' => 'ladilldomains-logo-email.png', + 'logo_class' => 'email-logo', + 'app_url' => env('LADILL_DOMAINS_APP_URL', 'https://domains.ladill.com'), + 'footer_account' => 'a Ladill Domains account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'domains.ladill.com', + ], + 'bird' => [ + 'name' => 'Ladill Bird', + 'logo' => 'ladillbird-logo-email.png', + 'logo_class' => 'email-logo', + 'app_url' => env('LADILL_BIRD_APP_URL', 'https://bird.ladill.com'), + 'footer_account' => 'a Ladill Bird account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'bird.ladill.com', + ], + 'mail' => [ + 'name' => 'Ladill Mail', + 'logo' => 'ladillmail-logo-email.png', + 'logo_class' => 'email-logo', + 'app_url' => env('LADILL_WEBMAIL_URL', 'https://mail.ladill.com'), + 'footer_account' => 'a Ladill Mail account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'mail.ladill.com', + ], + 'email' => [ + 'name' => 'Ladill Email', + 'logo' => 'ladillemail-logo-email.png', + 'logo_class' => 'email-logo', + 'app_url' => env('LADILL_EMAIL_APP_URL', 'https://email.ladill.com'), + 'footer_account' => 'a Ladill Email account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'email.ladill.com', + ], + 'qrplus' => [ + 'name' => 'Ladill QR Plus', + 'logo' => 'ladillqrplus-logo-email.png', + 'logo_class' => 'email-logo', + 'app_url' => env('LADILL_QR_APP_URL', 'https://qrplus.ladill.com'), + 'footer_account' => 'a Ladill QR Plus account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'qrplus.ladill.com', + ], + 'events' => [ + 'name' => 'Ladill Events', + 'logo' => 'ladillevents-logo-email.png', + 'logo_class' => 'email-logo', + 'app_url' => env('LADILL_EVENTS_APP_URL', 'https://events.ladill.com'), + 'footer_account' => 'a Ladill Events account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'events.ladill.com', + ], + 'transfer' => [ + 'name' => 'Ladill Transfer', + 'logo' => 'ladilltransfer-logo-email.png', + 'logo_class' => 'email-logo email-logo-transfer', + 'app_url' => env('LADILL_TRANSFER_APP_URL', 'https://transfer.ladill.com'), + 'footer_account' => 'a Ladill Transfer account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'transfer.ladill.com', + ], + 'mini' => [ + 'name' => 'Ladill Mini', + 'logo' => 'ladillmini-logo-email.png', + 'logo_class' => 'email-logo', + 'app_url' => env('LADILL_MINI_APP_URL', 'https://mini.ladill.com'), + 'footer_account' => 'a Ladill Mini account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'mini.ladill.com', + ], + 'servers' => [ + 'name' => 'Ladill Servers', + 'logo' => 'ladillservers-logo-email.png', + 'logo_class' => 'email-logo', + 'app_url' => env('LADILL_SERVERS_APP_URL', 'https://servers.ladill.com'), + 'footer_account' => 'a Ladill Servers account', + 'dashboard_path' => '/', + 'support_path' => '/support', + 'home_label' => 'servers.ladill.com', + ], + ], +]; diff --git a/resources/views/mail/notifications/event-programme.blade.php b/resources/views/mail/notifications/event-programme.blade.php index e98b883..ba5db16 100644 --- a/resources/views/mail/notifications/event-programme.blade.php +++ b/resources/views/mail/notifications/event-programme.blade.php @@ -1,5 +1,13 @@ @extends('mail.notifications.layout') +@section('email-header') + @include('mail.partials.brand-header', ['brand' => 'events']) +@endsection + +@section('email-footer') + @include('mail.partials.brand-footer', ['brand' => 'events']) +@endsection + @section('content')

📋 Programme Outline

diff --git a/resources/views/mail/notifications/layout.blade.php b/resources/views/mail/notifications/layout.blade.php index 39662cc..3662c00 100644 --- a/resources/views/mail/notifications/layout.blade.php +++ b/resources/views/mail/notifications/layout.blade.php @@ -374,7 +374,7 @@ @hasSection('email-header') @yield('email-header') @else - + @include('mail.partials.brand-header', ['brand' => 'ladill']) @endif
@@ -389,17 +389,11 @@ {{-- Footer --}} diff --git a/resources/views/mail/notifications/transfer-owner-grace.blade.php b/resources/views/mail/notifications/transfer-owner-grace.blade.php index 2261c8f..ef4c090 100644 --- a/resources/views/mail/notifications/transfer-owner-grace.blade.php +++ b/resources/views/mail/notifications/transfer-owner-grace.blade.php @@ -1,5 +1,13 @@ @extends('mail.notifications.layout') +@section('email-header') + @include('mail.partials.brand-header', ['brand' => 'transfer']) +@endsection + +@section('email-footer') + @include('mail.partials.brand-footer', ['brand' => 'transfer']) +@endsection + @section('content') @php $graceEnds = $transfer->grace_ends_at; diff --git a/resources/views/mail/notifications/transfer-recipient.blade.php b/resources/views/mail/notifications/transfer-recipient.blade.php index d057c05..85a50ee 100644 --- a/resources/views/mail/notifications/transfer-recipient.blade.php +++ b/resources/views/mail/notifications/transfer-recipient.blade.php @@ -1,7 +1,11 @@ @extends('mail.notifications.layout') @section('email-header') - + @include('mail.partials.brand-header', ['brand' => 'transfer']) +@endsection + +@section('email-footer') + @include('mail.partials.brand-footer', ['brand' => 'transfer']) @endsection @section('content') diff --git a/resources/views/mail/partials/brand-footer.blade.php b/resources/views/mail/partials/brand-footer.blade.php new file mode 100644 index 0000000..6f6b66a --- /dev/null +++ b/resources/views/mail/partials/brand-footer.blade.php @@ -0,0 +1,20 @@ +@php + $brandKey = $brand ?? 'ladill'; + $brandConfig = config("mail_brands.brands.{$brandKey}", config('mail_brands.brands.ladill')); + $appBase = rtrim((string) ($brandConfig['app_url'] ?? config('app.url')), '/'); + $dashboardPath = $brandConfig['dashboard_path'] ?? '/'; + $accountBase = rtrim((string) ($brandConfig['account_url'] ?? config('mail_brands.account_url', 'https://account.ladill.com')), '/'); + $supportUrl = $brandConfig['support_url'] ?? $accountBase.'/support-tickets'; + $homeLabel = $brandConfig['home_label'] ?? parse_url($appBase, PHP_URL_HOST) ?: 'ladill.com'; +@endphp + + + diff --git a/resources/views/mail/partials/brand-header.blade.php b/resources/views/mail/partials/brand-header.blade.php new file mode 100644 index 0000000..f6bce5a --- /dev/null +++ b/resources/views/mail/partials/brand-header.blade.php @@ -0,0 +1,7 @@ +@php + $brandKey = $brand ?? 'ladill'; + $brandConfig = config("mail_brands.brands.{$brandKey}", config('mail_brands.brands.ladill')); + $assetBase = rtrim((string) ($brandConfig['asset_url'] ?? config('app.url')), '/'); + $logoClass = trim((string) ($brandConfig['logo_class'] ?? 'email-logo')); +@endphp +{{ $brandConfig['name'] }} diff --git a/resources/views/partials/sidebar-support.blade.php b/resources/views/partials/sidebar-support.blade.php new file mode 100644 index 0000000..817932f --- /dev/null +++ b/resources/views/partials/sidebar-support.blade.php @@ -0,0 +1,23 @@ +@php + $useInternal = $internal ?? false; + if ($useInternal) { + $supportUrl = route('user.support-tickets.index'); + $openExternal = false; + } else { + $supportUrl = function_exists('ladill_account_url') + ? ladill_account_url('/support-tickets') + : 'https://'.config('app.account_domain', 'account.ladill.com').'/support-tickets'; + $openExternal = true; + } +@endphp + + + Support + @if($openExternal) + + @endif + diff --git a/resources/views/partials/sidebar.blade.php b/resources/views/partials/sidebar.blade.php index f00a760..045d431 100644 --- a/resources/views/partials/sidebar.blade.php +++ b/resources/views/partials/sidebar.blade.php @@ -41,6 +41,7 @@
+ @include('partials.sidebar-support')