Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix email failure bugs #11094

Conversation

GuySartorelli
Copy link
Member

@GuySartorelli GuySartorelli commented Dec 13, 2023

This PR fixes two related bugs.

For both bugs, this PR logs the error, but lets code execution continue
Note that there are two ways this exception can occur:

  1. admin_url is not a valid email address, so RfcComplianceException is thrown
  2. Something fails in symfony mailer while actually sending the email, so TransportExceptionInterface is thrown

Bug one

If there's an exception thrown when trying to send an email to a user in live mode when their password has been changed, the new password does not get saved.

Bug two

No issue open

When using the password recovery functionality ("I've lost my password"), if an exception is thrown when trying to send the recovery email, the whole page just breaks.

Instead of that, the user should be given a user-friendly error message, and the cause of the error should be logged.

Notes

  • With bug one specifically, there is some weird side-effect to logging the error which causes the success toast to be red (so it looks like a failure toast), and the page doesn't reload. But the new password is saved, so I'm raising a separate issue to look into that side effect. The bug this PR fixes is about saving the password value, and that bug is fixed with this PR.

Copy link
Member

@emteknetnz emteknetnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replicated both bugs locally and tested patch for both, works good. Just need to update the translation file

@GuySartorelli GuySartorelli force-pushed the pulls/5.1/fix-email-failure-bugs branch from b90cfdf to dd3a0db Compare December 14, 2023 20:05
@emteknetnz emteknetnz merged commit 3311794 into silverstripe:5.1 Dec 14, 2023
15 checks passed
@emteknetnz emteknetnz deleted the pulls/5.1/fix-email-failure-bugs branch December 14, 2023 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants