Skip to content

Instantly share code, notes, and snippets.

@pedro
Created August 12, 2008 20:06
Show Gist options
  • Save pedro/5142 to your computer and use it in GitHub Desktop.
Save pedro/5142 to your computer and use it in GitHub Desktop.
class UsersController ...
def create
@user = User.create(params[:user])
Notifier.deliver_activation(@user)
redirect_to :controller => :dashboard
rescue Exception => e
logger.error e
...
end
end
class UsersController ...
def create
@user = User.create(params[:user])
Notifier.deliver_activation(@user)
flash[:notice] = "Check your email to active your account"
rescue Heroku::Mailer::DailyQuotaReached
logger.warn "Reached the daily limit of outgoing emails! Skipping activation"
@user.activate
flash[:notice] = 'Thank you, your account is ready :)'
rescue Exception => e
logger.error e
...
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment