How can I override the forgot password email from address field?
I'm using the SendsPasswordResetEmails trait
.
It seems to be using the .env mail-from configuration
here is the trait vendor code SendsPasswordResetEmail Trait
sendResetLinkEmail method
seems to be where the magic happens but i cannot determine how to override the mail send from the broker where is this function? sendResetLink
You can just copy the trait its code and past it in the PasswordBroker
class to overwrite it if that's what you're asking.
I think you don't have to edit broker()
just override sendResetLinkEmail()
in your ForgetPasswordController
. Then override $request->mail
entry.
Anyway, the function you are looking for is at "\vendor\laravel\framework\src\Illuminate\Auth\Passwords\PasswordBroker.php" => sendResetLink()
I think what you are trying to do is set
MAIL_FROM_ADDRESS=sender@example.com
MAIL_FROM_NAME=Sender
in .env file and it should work fine, you do not need to override sendResetLinkEmail method
.