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

Sparkpost throws 500 when email is invalid, catching error doesn't work #39

Open
gbrl opened this issue Nov 7, 2016 · 0 comments
Open

Comments

@gbrl
Copy link

gbrl commented Nov 7, 2016

I followed the instructions in the README, setting up action_mailer.rb file to catch SparkPostRails::DeliveryException but it doesn't seem to work.

The issue is that if you use sparkpost with devise, and a user tries to register with an email that doesn't have any MX records... (example: [email protected]) sparkpost throws a DeliveryException, and my app crashes. Am I doing something wrong? Here's my action_mailer.rb file

ActionMailer::DeliveryJob.rescue_from(SparkPostRails::DeliveryException) do |exception|
  redirect_to '/logout', alert: "Please use a valid email address."
  # do something special with the error
end
@gbrl gbrl changed the title Devise registration throws 500 when email is invalid, catching error doesn't work Sparkpost throws 500 when email is invalid, catching error doesn't work Nov 7, 2016
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

No branches or pull requests

1 participant