Skip to content

Instantly share code, notes, and snippets.

@mrdoornbos
Created July 22, 2008 13:38
Show Gist options
  • Save mrdoornbos/950 to your computer and use it in GitHub Desktop.
Save mrdoornbos/950 to your computer and use it in GitHub Desktop.
class UserObserver < ActiveRecord::Observer
def after_create(user)
UserMailer.deliver_signup_notification(user)
end
def after_save(user)
UserMailer.deliver_activation(user) if user.recently_activated?
UserMailer.deliver_forgot_password(user) if user.recently_forgot_password?
UserMailer.deliver_reset_password(user) if user.recently_reset_password?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment