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:
@@ -26,18 +26,32 @@ class AddonPurchased extends Notification implements ShouldQueue
|
||||
$label = $this->addon->metadata['label'] ?? $this->addon->addon_key;
|
||||
$amount = $this->addon->amount ? number_format((float) $this->addon->amount, 2) : null;
|
||||
$currency = $this->addon->currency ?? 'EUR';
|
||||
$subject = __('emails.ops.addon.subject', ['addon' => $label]);
|
||||
$greeting = __('emails.ops.addon.greeting');
|
||||
$lines = [
|
||||
__('emails.ops.addon.tenant', ['tenant' => $tenant?->name ?? __('emails.tenant_feedback.unknown_tenant')]),
|
||||
__('emails.ops.addon.event', ['event' => $event?->name['de'] ?? $event?->name['en'] ?? $event?->name ?? __('emails.package_limits.event_fallback')]),
|
||||
__('emails.ops.addon.addon', ['addon' => $label, 'quantity' => $this->addon->quantity]),
|
||||
];
|
||||
|
||||
if ($amount) {
|
||||
$lines[] = __('emails.ops.addon.amount', ['amount' => $amount, 'currency' => $currency]);
|
||||
}
|
||||
|
||||
$lines[] = __('emails.ops.addon.provider', [
|
||||
'checkout' => $this->addon->checkout_id ?? '—',
|
||||
'transaction' => $this->addon->transaction_id ?? '—',
|
||||
]);
|
||||
|
||||
return (new MailMessage)
|
||||
->subject(__('emails.ops.addon.subject', ['addon' => $label]))
|
||||
->greeting(__('emails.ops.addon.greeting'))
|
||||
->line(__('emails.ops.addon.tenant', ['tenant' => $tenant?->name ?? __('emails.tenant_feedback.unknown_tenant')]))
|
||||
->line(__('emails.ops.addon.event', ['event' => $event?->name['de'] ?? $event?->name['en'] ?? $event?->name ?? __('emails.package_limits.event_fallback')]))
|
||||
->line(__('emails.ops.addon.addon', ['addon' => $label, 'quantity' => $this->addon->quantity]))
|
||||
->when($amount, fn ($mail) => $mail->line(__('emails.ops.addon.amount', ['amount' => $amount, 'currency' => $currency])))
|
||||
->line(__('emails.ops.addon.provider', [
|
||||
'checkout' => $this->addon->checkout_id ?? '—',
|
||||
'transaction' => $this->addon->transaction_id ?? '—',
|
||||
]))
|
||||
->line(__('emails.ops.addon.footer'));
|
||||
->subject($subject)
|
||||
->view('emails.notifications.basic', [
|
||||
'title' => $subject,
|
||||
'preheader' => $greeting,
|
||||
'heroTitle' => $greeting,
|
||||
'heroSubtitle' => $subject,
|
||||
'lines' => $lines,
|
||||
'footer' => __('emails.ops.addon.footer'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user