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:
@@ -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'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user