Last active
February 17, 2017 12:24
-
-
Save alekseyl/1451c54afa69d3c5d7c0a466cee7c429 to your computer and use it in GitHub Desktop.
deliver devise emails with threads
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def send_devise_notification(notification, *args) | |
# don't forget email not sended without calling deliver | |
message = devise_mailer.send(notification, self, *args) | |
# this is the params you want to anylise when something crashes | |
add_to_airbrake_notice = attributes.slice('email', 'name', 'surname', 'cell', 'id') | |
# run message delivering | |
run_async_with_rescue(add_to_airbrake_notice) { message.deliver } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment