- Add status checker + admin secure packages + upgrade enum + add sentry + upgrade to sitemap generator + bump to CRMV2 - Set customer role enum and user role enum - Update customer migration to set roles - phpcbf - faker local to fr - update lang - composer update - bump laravel ui - Redo all user crud - npm bump - Create admin command - rearrange views - redo all auth system - redo customer pro bo
64 lines
2 KiB
PHP
64 lines
2 KiB
PHP
<?php
|
|
|
|
namespace App\Notifications\Customer;
|
|
|
|
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(
|
|
'verification.verify',
|
|
Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)),
|
|
[
|
|
'id' => $notifiable->getKey(),
|
|
'hash' => sha1($notifiable->getEmailForVerification()),
|
|
],
|
|
false
|
|
));
|
|
};
|
|
}
|
|
|
|
/**
|
|
* Build the mail representation of the notification.
|
|
*
|
|
* @param mixed $notifiable
|
|
* @return \Illuminate\Notifications\Messages\MailMessage
|
|
*/
|
|
public function toMail($notifiable)
|
|
{
|
|
/** @var \App\Models\Customer\Customer $notifiable */
|
|
$verificationUrl = $this->verificationUrl($notifiable);
|
|
$firstname = $notifiable->api_data->firstname;
|
|
|
|
return (new MailMessage())
|
|
->subject(trans("Inscription - :siteName", ['siteName' => config('app.name')]))
|
|
/** @var string $firstname */
|
|
->greeting("Bonjour " . $firstname)
|
|
->line(trans(
|
|
"Vous venez de créer un compte sur :siteName.",
|
|
['siteName' => config('app.name')]
|
|
))
|
|
->line("Pour confirmer votre inscription, merci de cliquer sur le lien ci-dessous :")
|
|
/** @var string $verificationUrl */
|
|
->action(trans('Confirmer mon adresse email'), $verificationUrl);
|
|
}
|
|
}
|