Files
roxane/app/Notifications/MemberRenewalReminder3Notification.php
Nebulae ba11ee7120
All checks were successful
Deploy Roxane to Preprod / deploy (push) Successful in 1m21s
feat(Reminder process): add 4 reminder phases for membership (Retzien)
2026-09-06 17:03:14 +02:00

52 lines
1.2 KiB
PHP

<?php
namespace App\Notifications;
use App\Models\Member;
use App\Models\NotificationTemplate;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class MemberRenewalReminder3Notification extends Notification implements ShouldQueue
{
use Queueable;
public function __construct(
public readonly Member $member,
) {}
/**
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
public function toMail(object $notifiable): MailMessage
{
$template = NotificationTemplate::findByIdentifier('member_renewal_reminder_3');
$vars = [
'member_name' => $this->member->full_name,
'app_name' => config('app.front_name'),
];
return (new MailMessage)
->subject($template->renderSubject($vars))
->view('notifications.mail-template', [
'body' => $template->renderBody($vars),
]);
}
/**
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [];
}
}