Commit 35b52fa7 authored by Gabriel-31415's avatar Gabriel-31415
Browse files

ajuste email

parent ddeeff5d
<?php
namespace App\Notifications;
use Carbon\Carbon;
use Illuminate\Bus\Queueable;
use Illuminate\Support\Facades\URL;
use Illuminate\Support\Facades\Lang;
use Illuminate\Support\Facades\Config;
use Illuminate\Notifications\Notification;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Messages\MailMessage;
use Illuminate\Support\Facades\Auth;
class VerifyNotification extends Notification
{
use Queueable;
/**
* Create a new notification instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Get the notification's delivery channels.
*
* @param mixed $notifiable
* @return array
*/
public function via($notifiable)
{
return ['mail'];
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
$user = Auth::user();
return (new MailMessage)
->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()),
]
);
}
}
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
namespace App; namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail; use App\Notifications\recuperacaoSenha;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable; use Illuminate\Notifications\Notifiable;
use App\Notifications\VerifyNotification;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Contracts\Auth\CanResetPassword; use Illuminate\Contracts\Auth\CanResetPassword;
use App\Notifications\recuperacaoSenha; use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable implements MustVerifyEmail class User extends Authenticatable implements MustVerifyEmail
{ {
...@@ -99,4 +100,8 @@ class User extends Authenticatable implements MustVerifyEmail ...@@ -99,4 +100,8 @@ class User extends Authenticatable implements MustVerifyEmail
$this->notify(new recuperacaoSenha($token)); $this->notify(new recuperacaoSenha($token));
} }
public function sendEmailVerificationNotification(){
$this->notify(new VerifyNotification());
}
} }
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
@if (! empty($salutation)) @if (! empty($salutation))
{{ $salutation }} {{ $salutation }}
@else @else
@lang('Atenciosamente'),<br> <br>@lang('Atenciosamente'),<br>
{{ config('app.name') }}<br><br> {{ config('app.name') }}<br><br>
Laboratório Multidisciplinar de Tecnologias Sociais Laboratório Multidisciplinar de Tecnologias Sociais<br>
Universidade Federal do Agreste de Pernambuco Universidade Federal do Agreste de Pernambuco
@endif @endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment