Converted all notification emails to the branded layout by routing them through a shared Blade template and swapping

the MailMessage builders to use view(). This keeps the existing copy/labels but aligns the look with resources/views/
  emails/partials/layout.blade.php. I also switched the customer add‑on receipt notification to reuse the existing
  branded view and added missing translations for the upload pipeline alert.
This commit is contained in:
Codex Agent
2025-12-23 14:03:42 +01:00
parent 20ff3044e2
commit 207725d460
35 changed files with 1247 additions and 528 deletions

View File

@@ -30,22 +30,36 @@ class EventPackageGalleryExpiringNotification extends Notification implements Sh
$eventName = $event?->name['de'] ?? $event?->name['en'] ?? $event?->name ?? __('emails.package_limits.event_fallback');
$url = url('/tenant/events/'.($event?->slug ?? ''));
$subject = trans_choice('emails.package_limits.gallery_warning.subject', $this->daysRemaining, [
'event' => $eventName,
'days' => $this->daysRemaining,
]);
$greeting = __('emails.package_limits.gallery_warning.greeting', [
'name' => $tenant?->name ?? __('emails.package_limits.team_fallback'),
]);
return (new MailMessage)
->subject(trans_choice('emails.package_limits.gallery_warning.subject', $this->daysRemaining, [
'event' => $eventName,
'days' => $this->daysRemaining,
]))
->greeting(__('emails.package_limits.gallery_warning.greeting', [
'name' => $tenant?->name ?? __('emails.package_limits.team_fallback'),
]))
->line(trans_choice('emails.package_limits.gallery_warning.body', $this->daysRemaining, [
'event' => $eventName,
'package' => $package?->getNameForLocale() ?? $package?->name ?? __('emails.package_limits.package_fallback'),
'days' => $this->daysRemaining,
'date' => optional($this->eventPackage->gallery_expires_at)->toFormattedDateString(),
]))
->action(__('emails.package_limits.gallery_warning.action'), $url)
->line(__('emails.package_limits.footer'));
->subject($subject)
->view('emails.notifications.basic', [
'title' => $subject,
'preheader' => $greeting,
'heroTitle' => $greeting,
'heroSubtitle' => $subject,
'lines' => [
trans_choice('emails.package_limits.gallery_warning.body', $this->daysRemaining, [
'event' => $eventName,
'package' => $package?->getNameForLocale() ?? $package?->name ?? __('emails.package_limits.package_fallback'),
'days' => $this->daysRemaining,
'date' => optional($this->eventPackage->gallery_expires_at)->toFormattedDateString(),
]),
],
'cta' => [
[
'label' => __('emails.package_limits.gallery_warning.action'),
'url' => $url,
],
],
'footer' => __('emails.package_limits.footer'),
]);
}
}