Files
nutzwerte_fi4/app/Notifications/ResetPasswordNotification.php
T
2025-10-16 16:07:59 +02:00

64 lines
1.9 KiB
PHP

<?php
namespace App\Notifications;
use Filament\Facades\Filament;
use Illuminate\Bus\Queueable;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Facades\Lang;
class ResetPasswordNotification extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*/
public function __construct(private readonly string $token) {}
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(object $notifiable): array
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail(object $notifiable): MailMessage
{
return (new MailMessage)
->subject(Lang::get('Benachrichtigung zum Zurücksetzen des Passworts'))
->greeting(Lang::get('Hallo')." {$notifiable->name},")
->line(Lang::get('Sie erhalten diese E-Mail, weil wir eine Anfrage zum Zurücksetzen des Passworts für Ihr Konto erhalten haben.'))
->action(Lang::get('Passwort Zurücksetzen'), $this->resetUrl($notifiable))
->line(Lang::get('Dieser Link zum Zurücksetzen des Passworts läuft in 60 Minuten ab.'))
->line(Lang::get('Wenn Sie keine Passwortzurücksetzung beantragt haben, sind keine weiteren Maßnahmen erforderlich.'))
->line(Lang::get('Mit freundlichen Grüßen'))
->salutation(Lang::get('Nutzwerte Support Team'));
}
protected function resetUrl(mixed $notifiable): string
{
return Filament::getResetPasswordUrl($this->token, $notifiable);
}
/**
* Get the array representation of the notification.
*
*
* @return array<string, mixed>
*/
public function toArray(object $notifiable): array
{
return [
//
];
}
}