diff --git a/app/src/Controller/ResetPasswordController.php b/app/src/Controller/ResetPasswordController.php index e4b8c01..7353256 100644 --- a/app/src/Controller/ResetPasswordController.php +++ b/app/src/Controller/ResetPasswordController.php @@ -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; } /** @@ -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, @@ -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')