44 lines
1.2 KiB
PHP
44 lines
1.2 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): 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')
|
||
|
|
]));
|
||
|
|
}
|
||
|
|
}
|