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

@@ -25,19 +25,28 @@ class PurchaseCreated extends Notification implements ShouldQueue
$package = $this->purchase->package;
$amount = number_format((float) $this->purchase->price, 2);
$consents = $this->purchase->metadata['consents'] ?? [];
$subject = __('emails.ops.purchase.subject', ['package' => $package?->name ?? __('emails.package_limits.package_fallback')]);
$greeting = __('emails.ops.purchase.greeting');
return (new MailMessage)
->subject(__('emails.ops.purchase.subject', ['package' => $package?->name ?? __('emails.package_limits.package_fallback')]))
->greeting(__('emails.ops.purchase.greeting'))
->line(__('emails.ops.purchase.tenant', ['tenant' => $tenant?->name ?? __('emails.tenant_feedback.unknown_tenant')]))
->line(__('emails.ops.purchase.package', ['package' => $package?->name ?? __('emails.package_limits.package_fallback')]))
->line(__('emails.ops.purchase.amount', ['amount' => $amount, 'currency' => '€']))
->line(__('emails.ops.purchase.provider', ['provider' => $this->purchase->provider, 'id' => $this->purchase->provider_id ?? '—']))
->line(__('emails.ops.purchase.consents', [
'legal' => $consents['legal_version'] ?? 'n/a',
'terms' => $consents['accepted_terms_at'] ?? 'n/a',
'waiver' => $consents['digital_content_waiver_at'] ?? 'n/a',
]))
->line(__('emails.ops.purchase.footer'));
->subject($subject)
->view('emails.notifications.basic', [
'title' => $subject,
'preheader' => $greeting,
'heroTitle' => $greeting,
'heroSubtitle' => $subject,
'lines' => [
__('emails.ops.purchase.tenant', ['tenant' => $tenant?->name ?? __('emails.tenant_feedback.unknown_tenant')]),
__('emails.ops.purchase.package', ['package' => $package?->name ?? __('emails.package_limits.package_fallback')]),
__('emails.ops.purchase.amount', ['amount' => $amount, 'currency' => '']),
__('emails.ops.purchase.provider', ['provider' => $this->purchase->provider, 'id' => $this->purchase->provider_id ?? '—']),
__('emails.ops.purchase.consents', [
'legal' => $consents['legal_version'] ?? 'n/a',
'terms' => $consents['accepted_terms_at'] ?? 'n/a',
'waiver' => $consents['digital_content_waiver_at'] ?? 'n/a',
]),
],
'footer' => __('emails.ops.purchase.footer'),
]);
}
}