ldc-tregalette/app/Notifications/Customer/UpdatePassword.php
2024-01-30 12:30:24 +01:00

43 lines
1.3 KiB
PHP

<?php
namespace App\Notifications\Customer;
use Illuminate\Notifications\Notification;
use Illuminate\Notifications\Messages\MailMessage;
class UpdatePassword extends Notification
{
/**
* Get the notification's delivery channels.
*
* @param object $notifiable
* @return array<int, string>
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
*/
public function via(object $notifiable): array
{
// phpcs:enable
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param object $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail(object $notifiable): \Illuminate\Notifications\Messages\MailMessage
{
/** @var string $firstname */
$firstname = $notifiable->api_data->firstname;
return (new MailMessage())
->subject(trans("Mise à jour du mot de passe - :site_name", [
'site_name' => config('app.name')
]))
->greeting("Bonjour " . $firstname)
->line(trans("Le mot de passe associé à votre compte :site_name vient d'être modifié.", [
'site_name' => config('app.name')
]));
}
}