ldc-gen-game-web/app/Notifications/Customer/UpdatePassword.php

48 lines
1.3 KiB
PHP
Raw Permalink Normal View History

<?php
2026-10-02 12:09:46 +02:00
declare(strict_types=1);
namespace App\Notifications\Customer;
2023-12-12 12:25:45 +01:00
use App\Models\Settings;
use Illuminate\Notifications\Messages\MailMessage;
2026-10-02 12:09:46 +02:00
use Illuminate\Notifications\Notification;
class UpdatePassword extends Notification
{
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
2026-10-02 12:09:46 +02:00
*
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
*/
public function via(object $notifiable): array
{
// phpcs:enable
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
public function toMail(object $notifiable): MailMessage
{
2026-10-02 12:09:46 +02:00
/** @var Settings */
$settings = resolve(Settings::class);
2023-12-01 16:13:56 +01:00
/** @var \App\Models\Customer $notifiable */
/** @var string $first_name */
$first_name = $notifiable->api_data->firstname;
2026-10-02 12:09:46 +02:00
return new MailMessage()
->subject(trans('front.mails.subjects.update_password', [
2026-10-02 12:09:46 +02:00
'site_name' => $settings->name,
]))
->greeting(trans('front.mails.greetings.with_name', ['first_name' => $first_name]))
->line(trans('front.mails.contents.update_password', [
2026-10-02 12:09:46 +02:00
'site_name' => $settings->name,
]));
}
}