From 35b52fa7f0cc997f2793a608fc9158a88539bbd8 Mon Sep 17 00:00:00 2001 From: Gabriel-31415 Date: Wed, 2 Jun 2021 02:57:08 +0000 Subject: [PATCH] ajuste email --- app/Notifications/VerifyNotification.php | 84 +++++++++++++++++++ app/User.php | 11 ++- .../vendor/notifications/email.blade.php | 4 +- 3 files changed, 94 insertions(+), 5 deletions(-) create mode 100644 app/Notifications/VerifyNotification.php diff --git a/app/Notifications/VerifyNotification.php b/app/Notifications/VerifyNotification.php new file mode 100644 index 0000000..7075f89 --- /dev/null +++ b/app/Notifications/VerifyNotification.php @@ -0,0 +1,84 @@ +subject('Verifique seu e-mail') + ->greeting("Olá, {$user->name}!") + ->action( + 'Verifique seu E-mail', + $this->verificationUrl($notifiable) + ) + ->line("Por favor clique no link acima para verificar seu endereço de e-mail.") + ->line('Se você não criou uma conta, nenhuma ação adicional é necessária.') + ->markdown('vendor.notifications.email'); + } + + /** + * Get the array representation of the notification. + * + * @param mixed $notifiable + * @return array + */ + public function toArray($notifiable) + { + return [ + // + ]; + } + protected function verificationUrl($notifiable) + { + return URL::temporarySignedRoute( + 'verification.verify', + Carbon::now()->addMinute(Config::get('auth.verification.expire', 60)), + [ + 'id' => $notifiable->getKey(), + 'hash' => sha1($notifiable->getEmailForVerification()), + ] + ); + } +} diff --git a/app/User.php b/app/User.php index 0a42835..a15b4c9 100644 --- a/app/User.php +++ b/app/User.php @@ -2,11 +2,12 @@ namespace App; -use Illuminate\Contracts\Auth\MustVerifyEmail; -use Illuminate\Foundation\Auth\User as Authenticatable; +use App\Notifications\recuperacaoSenha; use Illuminate\Notifications\Notifiable; +use App\Notifications\VerifyNotification; +use Illuminate\Contracts\Auth\MustVerifyEmail; use Illuminate\Contracts\Auth\CanResetPassword; -use App\Notifications\recuperacaoSenha; +use Illuminate\Foundation\Auth\User as Authenticatable; class User extends Authenticatable implements MustVerifyEmail { @@ -99,4 +100,8 @@ class User extends Authenticatable implements MustVerifyEmail $this->notify(new recuperacaoSenha($token)); } + public function sendEmailVerificationNotification(){ + $this->notify(new VerifyNotification()); + } + } diff --git a/resources/views/vendor/notifications/email.blade.php b/resources/views/vendor/notifications/email.blade.php index 426656d..bf18704 100644 --- a/resources/views/vendor/notifications/email.blade.php +++ b/resources/views/vendor/notifications/email.blade.php @@ -43,9 +43,9 @@ @if (! empty($salutation)) {{ $salutation }} @else -@lang('Atenciosamente'),
+
@lang('Atenciosamente'),
{{ config('app.name') }}

-Laboratório Multidisciplinar de Tecnologias Sociais +Laboratório Multidisciplinar de Tecnologias Sociais
Universidade Federal do Agreste de Pernambuco @endif -- GitLab