Files
fotospiel-app/app/Notifications/InactiveTenantDeletionWarning.php
Codex Agent 207725d460 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.
2025-12-23 14:03:42 +01:00

52 lines
1.7 KiB
PHP

<?php
namespace App\Notifications;
use App\Models\Tenant;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class InactiveTenantDeletionWarning extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(private readonly Tenant $tenant, private readonly Carbon $plannedDeletion)
{
$this->afterCommit();
}
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
$locale = $this->tenant->user?->preferred_locale ?? app()->getLocale();
$formattedDate = $this->plannedDeletion->copy()->locale($locale)->translatedFormat('d. F Y');
$subject = __('profile.retention.warning_subject', [], $locale);
return (new MailMessage)
->subject($subject)
->view('emails.notifications.basic', [
'title' => $subject,
'preheader' => __('profile.retention.line1', ['name' => $this->tenant->name], $locale),
'heroTitle' => $subject,
'lines' => [
__('profile.retention.line1', ['name' => $this->tenant->name], $locale),
__('profile.retention.line2', ['date' => $formattedDate], $locale),
__('profile.retention.line3', [], $locale),
],
'cta' => [
[
'label' => __('profile.retention.action', [], $locale),
'url' => url('/login'),
],
],
]);
}
}