Skip to content

Commit

Permalink
fixed sending restore password email bug
Browse files Browse the repository at this point in the history
  • Loading branch information
msalakhov committed Apr 1, 2022
1 parent 8dfbfb5 commit 8574836
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/src/Controller/ResetPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ class ResetPasswordController extends AbstractController
use ResetPasswordControllerTrait;

private $resetPasswordHelper;
private $adminEmail;

public function __construct(ResetPasswordHelperInterface $resetPasswordHelper)
public function __construct(ResetPasswordHelperInterface $resetPasswordHelper, string $adminEmail)
{
$this->resetPasswordHelper = $resetPasswordHelper;
$this->adminEmail = $adminEmail;
}

/**
Expand Down Expand Up @@ -127,7 +129,7 @@ public function reset(Request $request, UserPasswordHasherInterface $passwordHas
]);
}

private function processSendingPasswordResetEmail(string $emailFormData, MailerInterface $mailer, string $adminEmail): RedirectResponse
private function processSendingPasswordResetEmail(string $emailFormData, MailerInterface $mailer): RedirectResponse
{
$user = $this->getDoctrine()->getRepository(User::class)->findOneBy([
'email' => $emailFormData,
Expand All @@ -154,7 +156,7 @@ private function processSendingPasswordResetEmail(string $emailFormData, MailerI
}

$email = (new TemplatedEmail())
->from(new Address($adminEmail, 'Insurance Mail Bot'))
->from(new Address($this->adminEmail, 'Insurance Mail Bot'))
->to($user->getEmail())
->subject('Your password reset request')
->htmlTemplate('reset_password/email.html.twig')
Expand Down

0 comments on commit 8574836

Please sign in to comment.