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

@@ -35,38 +35,45 @@ class TenantFeedbackSubmitted extends Notification implements ShouldQueue
'tenant' => $tenantName,
'sentiment' => $sentiment,
]);
$mail = (new MailMessage())
->subject($subject)
->line(__('emails.tenant_feedback.tenant', ['tenant' => $tenantName]))
->line(__('emails.tenant_feedback.category', ['category' => $this->feedback->category ? Str::headline($this->feedback->category) : '—']))
->line(__('emails.tenant_feedback.sentiment', ['sentiment' => $sentiment]));
$lines = [
__('emails.tenant_feedback.tenant', ['tenant' => $tenantName]),
__('emails.tenant_feedback.category', ['category' => $this->feedback->category ? Str::headline($this->feedback->category) : '—']),
__('emails.tenant_feedback.sentiment', ['sentiment' => $sentiment]),
];
if ($eventName) {
$mail->line(__('emails.tenant_feedback.event', ['event' => $eventName]));
$lines[] = __('emails.tenant_feedback.event', ['event' => $eventName]);
}
if ($rating) {
$mail->line(__('emails.tenant_feedback.rating', ['rating' => $rating]));
$lines[] = __('emails.tenant_feedback.rating', ['rating' => $rating]);
}
if ($this->feedback->title) {
$mail->line(__('emails.tenant_feedback.title', ['subject' => $this->feedback->title]));
$lines[] = __('emails.tenant_feedback.title', ['subject' => $this->feedback->title]);
}
if ($this->feedback->message) {
$mail->line(__('emails.tenant_feedback.message'))->line($this->feedback->message);
$lines[] = __('emails.tenant_feedback.message');
$lines[] = $this->feedback->message;
}
$url = TenantFeedbackResource::getUrl('view', ['record' => $this->feedback], panel: 'superadmin');
if ($url) {
$mail->action(__('emails.tenant_feedback.open'), $url);
}
$lines[] = __('emails.tenant_feedback.received_at', ['date' => $this->feedback->created_at?->toDayDateTimeString()]);
$mail->line(__('emails.tenant_feedback.received_at', ['date' => $this->feedback->created_at?->toDayDateTimeString()]));
return $mail;
return (new MailMessage)
->subject($subject)
->view('emails.notifications.basic', [
'title' => $subject,
'preheader' => $subject,
'heroTitle' => $subject,
'lines' => $lines,
'cta' => $url ? [[
'label' => __('emails.tenant_feedback.open'),
'url' => $url,
]] : [],
]);
}
protected function resolveName(mixed $name): ?string