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\Auth\Notifications\VerifyEmail as NotificationsVerifyEmail;
|
|
|
|
|
use Illuminate\Notifications\Messages\MailMessage;
|
|
|
|
|
use Illuminate\Support\Carbon;
|
|
|
|
|
use Illuminate\Support\Facades\Config;
|
|
|
|
|
use Illuminate\Support\Facades\URL;
|
|
|
|
|
|
|
|
|
|
class VerifyEmail extends NotificationsVerifyEmail
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* The callback that should be used to create the reset password URL.
|
|
|
|
|
*
|
|
|
|
|
* @var \Closure|null
|
|
|
|
|
*/
|
|
|
|
|
public static $createUrlCallback;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* VerifyEmail
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function __construct()
|
|
|
|
|
{
|
|
|
|
|
static::$createUrlCallback = function ($notifiable) {
|
|
|
|
|
return \url(URL::temporarySignedRoute(
|
|
|
|
|
'fo.verification.verify',
|
|
|
|
|
Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)),
|
|
|
|
|
[
|
|
|
|
|
'id' => $notifiable->getKey(),
|
|
|
|
|
'hash' => sha1($notifiable->getEmailForVerification()),
|
|
|
|
|
],
|
|
|
|
|
true
|
|
|
|
|
));
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Build the mail representation of the notification.
|
|
|
|
|
*
|
|
|
|
|
* @param mixed $notifiable
|
|
|
|
|
* @return \Illuminate\Notifications\Messages\MailMessage
|
|
|
|
|
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
|
|
|
|
|
*/
|
|
|
|
|
public function toMail($notifiable)
|
|
|
|
|
{
|
|
|
|
|
// phpcs:enable
|
2023-12-01 16:13:56 +01:00
|
|
|
/** @var \App\Models\Settings */
|
|
|
|
|
$settings = app(Settings::class);
|
|
|
|
|
|
2023-11-29 10:57:48 +01:00
|
|
|
/** @var \App\Models\Customer\Customer $notifiable */
|
|
|
|
|
/** @var string $verificationUrl */
|
|
|
|
|
$verificationUrl = $this->verificationUrl($notifiable);
|
|
|
|
|
/** @var string $first_name */
|
|
|
|
|
$first_name = $notifiable->api_data->firstname;
|
|
|
|
|
|
|
|
|
|
return (new MailMessage())
|
|
|
|
|
->success()
|
2023-12-01 16:13:56 +01:00
|
|
|
->subject(trans("Inscription - :site_name", ['site_name' => $settings->name]))
|
2023-11-29 10:57:48 +01:00
|
|
|
->greeting(trans('Bonjour :first_name', ['first_name' => $first_name]))
|
|
|
|
|
->line(trans('Vous n\'êtes plus qu\'à un clic de votre inscription... '))
|
|
|
|
|
->line(trans('Pour finaliser votre inscription, merci de cliquer sur le lien ci-dessous :'))
|
|
|
|
|
->action(trans('Confirmer mon adresse email'), $verificationUrl)
|
|
|
|
|
->line(trans(
|
|
|
|
|
'Si vous avez des questions, n\'hésitez pas à nous contacter via notre formulaire de contact'
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|