silverstripe / silverstripe-framework

Silverstripe Framework, the MVC framework that powers Silverstripe CMS
https://www.silverstripe.org
BSD 3-Clause "New" or "Revised" License
722 stars 821 forks source link

Fix email failure bugs #11094

Closed GuySartorelli closed 9 months ago

GuySartorelli commented 9 months ago

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