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

49 lines
1.5 KiB
PHP

<?php
namespace App\Notifications\Customer;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
class DestroyCustomer 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("Supression du compte - :site_name", [
'site_name' => config('app.name')
]))
->greeting("Bonjour " . $firstname)
->line(trans(
"Votre compte :site_name a été marqué pour suppression,
il sera définitivement effacé au bout de 1 semaine.
Vous pourrez le réactiver durant ce délai si vous le
souhaitez en vous reconnectant.",
[
'site_name' => config('app.name')
]
));
}
}