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: user@gmails.com) 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
I followed the instructions in the README, setting up action_mailer.rb file to catch
SparkPostRails::DeliveryExceptionbut 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: user@gmails.com) sparkpost throws a DeliveryException, and my app crashes. Am I doing something wrong? Here's my action_mailer.rb file