Files
opensem/app/Notifications/VerifyEmail.php
Ludovic CANDELLIER 06cfb92757 [WIP] Order process
2022-07-03 22:38:08 +02:00

45 lines
1.4 KiB
PHP

<?php
namespace App\Notifications;
use Illuminate\Auth\Notifications\VerifyEmail as BaseEmail;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\URL;
class VerifyEmail extends BaseEmail
{
protected function verificationUrl($notifiable)
{
if (static::$createUrlCallback) {
return call_user_func(static::$createUrlCallback, $notifiable);
}
return URL::temporarySignedRoute(
'boilerplate.verification.verify',
Carbon::now()->addMinutes(Config::get('auth.verification.expire', 60)),
[
'id' => $notifiable->getKey(),
'hash' => sha1($notifiable->getEmailForVerification()),
]
);
}
/**
* Get the verify email notification mail message for the given URL.
*
* @param string $url
* @return \Illuminate\Notifications\Messages\MailMessage
*/
protected function buildMailMessage($url)
{
return (new MailMessage)
->markdown('boilerplate::notifications.email')
->subject(__('Verify Email Address'))
->line(__('Please click the button below to verify your email address.'))
->action(__('Verify Email Address'), $url)
->line(__('If you did not create an account, no further action is required.'));
}
}