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

@@ -1,41 +1,48 @@
@extends('emails.partials.layout')
@php
$withdrawalUrl = app()->getLocale() === 'de' ? url('/de/widerrufsbelehrung') : url('/en/withdrawal');
$subject = $forRecipient
? __('emails.gift_voucher.recipient.subject', ['amount' => $amount, 'currency' => $currency])
: __('emails.gift_voucher.purchaser.subject', ['amount' => $amount, 'currency' => $currency]);
$greeting = $forRecipient
? __('emails.gift_voucher.recipient.greeting')
: __('emails.gift_voucher.purchaser.greeting');
$subtitle = $forRecipient
? __('emails.gift_voucher.recipient.subtitle')
: __('emails.gift_voucher.purchaser.subtitle');
$body = $forRecipient
? __('emails.gift_voucher.recipient.body', [
'amount' => $amount,
'currency' => $currency,
'purchaser' => $voucher->purchaser_email,
])
: __('emails.gift_voucher.purchaser.body', [
'amount' => $amount,
'currency' => $currency,
'recipient' => $voucher->recipient_email ?: __('emails.gift_voucher.purchaser.recipient_fallback'),
]);
@endphp
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="UTF-8">
<title>{{ $forRecipient ? __('emails.gift_voucher.recipient.subject', ['amount' => $amount, 'currency' => $currency]) : __('emails.gift_voucher.purchaser.subject', ['amount' => $amount, 'currency' => $currency]) }}</title>
</head>
<body style="font-family: Arial, sans-serif; background-color: #f7f7f7; padding: 20px; color: #111827;">
<div style="max-width: 640px; margin: 0 auto; background: #ffffff; border-radius: 10px; padding: 28px; box-shadow: 0 10px 30px rgba(0,0,0,0.05);">
<h1 style="margin-top: 0; font-size: 22px;">
{{ $forRecipient ? __('emails.gift_voucher.recipient.greeting') : __('emails.gift_voucher.purchaser.greeting') }}
</h1>
<p style="font-size: 15px; line-height: 1.6; margin-bottom: 16px;">
{!! $forRecipient
? __('emails.gift_voucher.recipient.body', [
'amount' => $amount,
'currency' => $currency,
'purchaser' => $voucher->purchaser_email,
])
: __('emails.gift_voucher.purchaser.body', [
'amount' => $amount,
'currency' => $currency,
'recipient' => $voucher->recipient_email ?: __('emails.gift_voucher.purchaser.recipient_fallback'),
])
!!}
</p>
@section('title', $subject)
@section('preheader', $subtitle)
@section('hero_title', $greeting)
@section('hero_subtitle', $subtitle)
@section('content')
<p style="margin:0 0 12px; font-size:15px; color:#1f2937;">
{!! $body !!}
</p>
@if ($voucher->message)
<div style="margin: 18px 0; padding: 14px 16px; background: #f3f4f6; border-left: 4px solid #2563eb; border-radius: 8px;">
<strong>{{ __('emails.gift_voucher.message_title') }}</strong>
<p style="margin: 8px 0 0; white-space: pre-line;">{{ $voucher->message }}</p>
</div>
@endif
<div style="margin: 18px 0; padding: 16px; border: 1px dashed #d1d5db; border-radius: 10px; background: #f9fafb;">
<p style="margin: 0 0 6px; font-size: 14px; color: #6b7280;">{{ __('emails.gift_voucher.code_label') }}</p>
<p style="margin: 0 0 6px; font-size: 13px; text-transform:uppercase; letter-spacing:0.08em; color: #6b7280;">
{{ __('emails.gift_voucher.code_label') }}
</p>
<div style="display: inline-block; padding: 10px 14px; background: #111827; color: #ffffff; border-radius: 8px; font-weight: bold; letter-spacing: 1px;">
{{ $voucher->code }}
</div>
@@ -44,22 +51,18 @@
</p>
@isset($printUrl)
<p style="margin: 8px 0 0; font-size: 14px;">
<a href="{{ $printUrl }}">{{ __('emails.gift_voucher.printable') }}</a>
<a href="{{ $printUrl }}" style="color:#1d4ed8; text-decoration:none;">{{ __('emails.gift_voucher.printable') }}</a>
</p>
@endisset
</div>
<p style="font-size: 14px; color: #4b5563; margin: 12px 0;">
{{ __('emails.gift_voucher.expiry', ['date' => optional($voucher->expires_at)->toFormattedDateString()]) }}
</p>
<p style="font-size: 14px; color: #4b5563; margin: 12px 0;">
{!! __('emails.gift_voucher.withdrawal', ['url' => $withdrawalUrl]) !!}
</p>
@endsection
<p style="font-size: 14px; color: #4b5563; margin-top: 20px;">
{!! __('emails.gift_voucher.footer') !!}
</p>
</div>
</body>
</html>
@section('footer')
{!! __('emails.gift_voucher.footer') !!}
@endsection