ldc-legaulois/app/Notifications/Customer/UpdatePassword.php

48 lines
1.4 KiB
PHP
Raw Normal View History

2024-07-05 16:34:57 +02:00
<?php
namespace App\Notifications\Customer;
use Illuminate\Notifications\Messages\MailMessage;
2026-09-25 16:25:31 +02:00
use Illuminate\Notifications\Notification;
use Symfony\Component\Mime\Email;
2024-07-05 16:34:57 +02:00
class UpdatePassword extends Notification
{
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(): array
2024-07-05 16:34:57 +02:00
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*/
2026-09-25 16:25:31 +02:00
public function toMail(object $notifiable): MailMessage
2024-07-05 16:34:57 +02:00
{
return (new MailMessage())
->view([
'html' => 'notifications::email-club',
'text' => 'notifications::email-club-text',
])
2026-09-25 16:25:31 +02:00
->subject(trans('Mise à jour du mot de passe - :site_name', [
'site_name' => config('app.name'),
2024-07-05 16:34:57 +02:00
]))
->greeting(trans('Bonjour :name,', ['name' => $notifiable->api_data->firstname]))
->line(trans(
"Le mot de passe associé à votre compte :strong sur le Club des Gaulois :endStrong vient d'être modifié.",
[
2026-09-25 16:25:31 +02:00
'strong' => '<strong>',
'endStrong' => '</strong>',
]
))
->action(trans('Me connecter au club'), route('club.login'))
->withSymfonyMessage(function (Email $message) {
$message->html($message->getHtmlBody(), 'utf-8');
});
2024-07-05 16:34:57 +02:00
}
}