How can I customize the password recovery email for Laravel 5.4, I need to change the language but can not find the place to edit.
How can I customize the password recovery email for Laravel 5.4, I need to change the language but can not find the place to edit.
Step-by-step instruction:
You must create a new notification class to override the default message text.
To create a new notification class you must use this command line:
php artisan make:notification meuResetDeSenha
This will create the new class 'myResetDeSenha' in the app / Notifications directory.
Change the constructor of the generated file to:
public function __construct($token)
{
$this->token = $token;
}
Add the following import to the user's template (probably in app / User.php):
use App\Notifications\meuResetDeSenha;
Add this new method to the user template:
public function sendPasswordResetNotification($token)
{
$this->notify(new meuResetDeSenha($token));
}
Turn the following artisan command to publish the changes.
php artisan vendor:publish --tag=laravel-notifications
After running this command, the notification mail template will be located in the resources / views / vendor / notifications
Edit the inline and action text of the toMail () method in your myResetDeSenha 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 link
Although most will be translated from link , I added step 2 in my answer because I needed to implement it to work here and I added the markdown in step 6.
the translation files are in the resource / lang / the file referring to the login areas is auth.php you can edit it as you want.
I think the file is this:
resources / views / vendor / notifications / email.blade.php