Skip to content

Instantly share code, notes, and snippets.

@alekseyl
Last active February 17, 2017 12:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alekseyl/1451c54afa69d3c5d7c0a466cee7c429 to your computer and use it in GitHub Desktop.
Save alekseyl/1451c54afa69d3c5d7c0a466cee7c429 to your computer and use it in GitHub Desktop.
deliver devise emails with threads
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