diff --git a/.env_default b/.env_default index d0a85c567c16a1bd519f4e1cb1b79ab8e3e2cd01..712121157ff2b56174c08be1712df4dff76788ae 100644 --- a/.env_default +++ b/.env_default @@ -60,6 +60,8 @@ BY_PASS_CODE=ed156b9188ecddf0c556d5712f0a84cc # Use smtp or mail in production MAILER_DSN=null://null SYMFONY_SECRET=0f817363a768f111a17d2522b8d7e2d72cf738b1 +MAILER_SENDER=contact@localhost.com + LEGACY_SRC_SHARED=./capsule-prototype LEGACY_URL=http://legacy/ LEGACY_URL_EXTERNAL=http://localhost:8081/legacy/ diff --git a/config/packages/mailer.yaml b/config/packages/mailer.yaml index 56a650d89b2aec830ca3618bbdc7b6ff752e3501..d9c251e5bb7f21e228c1e8c8d9b53da18d48cb85 100644 --- a/config/packages/mailer.yaml +++ b/config/packages/mailer.yaml @@ -1,3 +1,7 @@ framework: mailer: dsn: '%env(MAILER_DSN)%' + envelope: + sender: '%env(MAILER_SENDER)%' + headers: + from: 'MemoRekall <%env(MAILER_SENDER)%>' \ No newline at end of file diff --git a/src/Controller/RegistrationController.php b/src/Controller/RegistrationController.php index c07ad950db8eeaa36959610081e0bb2f473c66c9..22b0b9cb5ffb9f2fe327228ffb527a8b14d87171 100644 --- a/src/Controller/RegistrationController.php +++ b/src/Controller/RegistrationController.php @@ -65,7 +65,6 @@ class RegistrationController extends AbstractController 'app_verify_email', $user, (new TemplatedEmail()) - ->from(new Address('contact@localhost.com', 'MemoRekall')) ->to($user->getEmail()) ->subject('Please Confirm your Email') ->htmlTemplate('registration/confirmation_email.html.twig') diff --git a/src/Controller/ResetPasswordController.php b/src/Controller/ResetPasswordController.php index 2a0236a3ea1a1f079cb91dc2595ad1c119e97a4a..1df4e65ea000e3b05024302d81a75830f2aca8e4 100644 --- a/src/Controller/ResetPasswordController.php +++ b/src/Controller/ResetPasswordController.php @@ -153,20 +153,10 @@ class ResetPasswordController extends AbstractController try { $resetToken = $this->resetPasswordHelper->generateResetToken($user); } catch (ResetPasswordExceptionInterface $e) { - // If you want to tell the user why a reset email was not sent, uncomment - // the lines below and change the redirect to 'app_forgot_password_request'. - // Caution: This may reveal if a user is registered or not. - // - // $this->addFlash('reset_password_error', sprintf( - // 'There was a problem handling your password reset request - %s', - // $e->getReason() - // )); - return $this->redirectToRoute('app_check_email'); } $email = (new TemplatedEmail()) - ->from(new Address('contact@localhost.com', 'MemoRekall')) ->to($user->getEmail()) ->subject('Your password reset request') ->htmlTemplate('reset_password/email.html.twig')