Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
35b52fa7
Commit
35b52fa7
authored
Jun 02, 2021
by
Gabriel-31415
Browse files
ajuste email
parent
ddeeff5d
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Notifications/VerifyNotification.php
0 → 100644
View file @
35b52fa7
<?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
()),
]
);
}
}
app/User.php
View file @
35b52fa7
...
@@ -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
());
}
}
}
resources/views/vendor/notifications/email.blade.php
View file @
35b52fa7
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment