Certificate manager built on Laravel 13, Livewire 4, and Flux. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications;
|
|
|
|
use App\Models\Certificate;
|
|
use App\Models\User;
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
class CertificateExpiredNotification extends Notification
|
|
{
|
|
use Queueable;
|
|
|
|
public function __construct(public Certificate $certificate) {}
|
|
|
|
/**
|
|
* @return array<int, string>
|
|
*/
|
|
public function via(object $notifiable): array
|
|
{
|
|
return ['mail'];
|
|
}
|
|
|
|
public function toMail(User $notifiable): MailMessage
|
|
{
|
|
return (new MailMessage)
|
|
->error()
|
|
->subject(__('Certificate expires today: :title', ['title' => $this->certificate->title]))
|
|
->greeting(__('Hello :name,', ['name' => $notifiable->name]))
|
|
->line(__('Your certificate ":title" expires today.', ['title' => $this->certificate->title]))
|
|
->action(__('View your certificates'), route('certificates.index'))
|
|
->line(__('Renew it as soon as possible to avoid a lapse in compliance.'));
|
|
}
|
|
}
|