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:
@@ -11,9 +11,7 @@ class UploadPipelineFailed extends Notification implements ShouldQueue
|
||||
{
|
||||
use Queueable;
|
||||
|
||||
public function __construct(private readonly array $context)
|
||||
{
|
||||
}
|
||||
public function __construct(private readonly array $context) {}
|
||||
|
||||
public function via(object $notifiable): array
|
||||
{
|
||||
@@ -29,15 +27,29 @@ class UploadPipelineFailed extends Notification implements ShouldQueue
|
||||
public function toMail(object $notifiable): MailMessage
|
||||
{
|
||||
$context = $this->context;
|
||||
$job = $context['job'] ?? 'n/a';
|
||||
$queue = $context['queue'] ?? 'n/a';
|
||||
$eventId = $context['event_id'] ?? 'n/a';
|
||||
$photoId = $context['photo_id'] ?? 'n/a';
|
||||
$exception = $context['exception'] ?? 'n/a';
|
||||
$timestamp = now()->toDateTimeString();
|
||||
|
||||
return (new MailMessage)
|
||||
->subject('Upload-Pipeline Fehler: '.($context['job'] ?? 'Unbekannter Job'))
|
||||
->line('In der Upload-Pipeline ist ein Fehler aufgetreten.')
|
||||
->line('Job: '.($context['job'] ?? 'n/a'))
|
||||
->line('Queue: '.($context['queue'] ?? 'n/a'))
|
||||
->line('Event ID: '.($context['event_id'] ?? 'n/a'))
|
||||
->line('Foto ID: '.($context['photo_id'] ?? 'n/a'))
|
||||
->line('Exception: '.($context['exception'] ?? 'n/a'))
|
||||
->line('Zeitpunkt: '.now()->toDateTimeString());
|
||||
->subject(__('emails.upload_pipeline_failed.subject', ['job' => $job]))
|
||||
->view('emails.notifications.basic', [
|
||||
'title' => __('emails.upload_pipeline_failed.subject', ['job' => $job]),
|
||||
'preheader' => __('emails.upload_pipeline_failed.preheader'),
|
||||
'heroTitle' => __('emails.upload_pipeline_failed.hero_title'),
|
||||
'heroSubtitle' => __('emails.upload_pipeline_failed.hero_subtitle'),
|
||||
'lines' => [
|
||||
__('emails.upload_pipeline_failed.line_job', ['job' => $job]),
|
||||
__('emails.upload_pipeline_failed.line_queue', ['queue' => $queue]),
|
||||
__('emails.upload_pipeline_failed.line_event', ['event' => $eventId]),
|
||||
__('emails.upload_pipeline_failed.line_photo', ['photo' => $photoId]),
|
||||
__('emails.upload_pipeline_failed.line_exception', ['exception' => $exception]),
|
||||
__('emails.upload_pipeline_failed.line_time', ['time' => $timestamp]),
|
||||
],
|
||||
'footer' => __('emails.upload_pipeline_failed.footer'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user