2023-11-29 10:57:48 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Notifications\Customer;
|
|
|
|
|
|
2023-12-12 12:25:45 +01:00
|
|
|
use App\Models\Settings;
|
2023-11-29 10:57:48 +01:00
|
|
|
use Illuminate\Notifications\Notification;
|
|
|
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
|
|
|
|
|
|
class UpdateEmail 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
|
|
|
|
|
{
|
2023-12-01 16:13:56 +01:00
|
|
|
/** @var \App\Models\Settings */
|
|
|
|
|
$settings = app(Settings::class);
|
|
|
|
|
|
2024-01-17 14:57:47 +01:00
|
|
|
/** @var \App\Models\Customer $notifiable */
|
2023-11-29 10:57:48 +01:00
|
|
|
/** @var string $first_name */
|
|
|
|
|
$first_name = $notifiable->api_data->firstname;
|
|
|
|
|
|
|
|
|
|
return (new MailMessage())
|
|
|
|
|
->subject(trans('Mise à jour de l\'email - :site_name', [
|
2023-12-01 16:13:56 +01:00
|
|
|
'site_name' => $settings->name
|
2023-11-29 10:57:48 +01:00
|
|
|
]))
|
|
|
|
|
->greeting(trans('Bonjour :first_name', ['first_name' => $first_name]))
|
|
|
|
|
->line(trans('L\'email associé à votre compte :site_name vient d\'être modifié.', [
|
2023-12-01 16:13:56 +01:00
|
|
|
'site_name' => $settings->name
|
2023-11-29 10:57:48 +01:00
|
|
|
]));
|
|
|
|
|
}
|
|
|
|
|
}
|