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

44 lines
1.4 KiB
PHP

<?php
namespace App\Notifications\Customer;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Notifications\Notification;
use Symfony\Component\Mime\Email;
class DestroyedCustomer extends Notification
{
/**
* Get the notification's delivery channels.
*
* @return array<int, string>
*/
public function via(): array
{
return ['mail'];
}
/**
* Build the mail representation of the notification.
*/
public function toMail(): MailMessage
{
return (new MailMessage())
->view([
'html' => 'notifications::email-club',
'text' => 'notifications::email-club-text',
])
->subject(trans('Votre compte est suprimé - :site_name', [
'site_name' => config('app.name'),
]))
->greeting('Bonjour')
->line(trans(
"Votre compte :site_name a été définitivement supprimé ainsi ques les données associés,
si vous aviez effectué une commande elle sera bien sûr toujours honorée. Les commandes associés
a votre compte continueront d'exister mais les données de votre compte ont bien été supprimées.",
['site_name' => config('app.name')]
))->withSymfonyMessage(function (Email $message) {
$message->html($message->getHtmlBody(), 'utf-8');
});
}
}