7
As I can customize the Laravel 5.4 password recovery email, I need to change the language but can’t find the place to edit.
7
As I can customize the Laravel 5.4 password recovery email, I need to change the language but can’t find the place to edit.
11
Step-by-step instruction:
You must create a new notification class to override the default text of the message.
To create a new notification class you must use this command line:
php artisan make:notification meuResetDeSenha
This will create the new class 'myResetDelf' in the app/Notifications directory.
Change the generated file constructor to:
public function __construct($token)
{
$this->token = $token;
}
Add the following import to the user model (probably in app/User.php):
use App\Notifications\meuResetDeSenha;
Add this new method to the user model:
public function sendPasswordResetNotification($token)
{
$this->notify(new meuResetDeSenha($token));
}
Run the following Artisan command to publish the changes.
php artisan vendor:publish --tag=laravel-notifications
After running this command, the notification email template will be located in the Resources/views/vendor/Notifications directory
Edit the text in line and action of the toMail() method in your myResetDelf class
public function toMail($notifiable)
{
return (new MailMessage)
->subject('Assunto do email')
->greeting('Olá!')
->line('Você está recebendo este e-mail porque nós recebemos uma requisição para sua conta.')
->action('REDEFINIR SENHA', route('password.reset', $this->token))
->line('Se você não requisitou uma redefiniçã de senha, nenhuma ação é necessária.')
->markdown('vendor.notifications.email');
}
This is described in https://laravel.com/docs/5.4/notifications#formatting-mail-messages
Although most of it is translated from https://stackoverflow.com/questions/39327954/laravel-5-3-redefine-reset-email-blade-template , I added step 2 in my reply, as I needed to implement it to work here and added markdown in step 6.
1
the translation files are in the Resource/lang/ folder the file referring to the login areas is auth.php you can edit it as you like.
I have already changed these files, they serve only for the validation of the fields, what I need is to edit the password recovery email that the Standard sends.
0
I think that’s the file:
Resources/views/vendor/Notifications/email.blade.php
Browser other questions tagged laravel laravel-5 email laravel-auth
You are not signed in. Login or sign up in order to post.
Need to do something else, does not send the email gives Failed to load Resource: the server responded with a status of 500 (Internal Server Error)... Have somewhere other than . env to include email settings.. type smtp, port. etc... Obs. I am already sending emails in another view set up in . env...
– Ulisses Gimenes
It even has in /config/mail.php, but I don’t know if it’s there what you need.
– Luciano Gonçalves