playasoft / volunteers

A volunteer scheduling system for festivals and events
https://volunteer.apogaea.com
GNU Affero General Public License v3.0
34 stars 12 forks source link

Error handling for SMTP configuration failures #191

Open itsrachelfish opened 4 years ago

itsrachelfish commented 4 years ago

We are currently getting an unhandled 500 server error on production because the SMTP credentials we were using were invalidated. Now whenever somebody tries to sign up for a shift it says "Whoops. Something went wrong" because the SMTP server is rejecting our username / password.

[2020-05-24 08:20:16] prod.ERROR: Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8  https://support.google.com/mail/?p=BadCredentials 2sm1105625pfd.163 - gsmtp
" {"userId":1,"email":"rachel@wetfish.net","exception":"[object] (Swift_TransportException(code: 535): Expected response code 250 but got code \"535\", with message \"535-5.7.8 Username and Password not accepted. Learn more at
535 5.7.8  https://support.google.com/mail/?p=BadCredentials 2sm1105625pfd.163 - gsmtp
\" at /home/voldb/laravel-voldb/laravel/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:419)

Fortunately users can still sign up for shifts despite the error message because sending a notification is the last step of the process.

itsrachelfish commented 4 years ago

Possible solution: SMTP configuration errors should be handled gracefully by notifying end users via a flash message that they signed up for the shift but an email confirmation could not be sent due to the SMTP error.

"Success! You've signed up for this shift."

"Warning: Unable to send email confirmation, SMTP error. Please notify the administrator of this volunteer database."