added upgrade mailer

This commit is contained in:
albert
2011-12-02 16:46:37 -05:00
parent caf39d1962
commit 4baf5be7a2
7 changed files with 28 additions and 4 deletions

View File

@@ -41,6 +41,16 @@ class UsersController < ApplicationController
@user.update_attributes(params[:user], :as => CurrentUser.role)
respond_with(@user)
end
def upgrade
@user = User.find(params[:id])
if params[:email] =~ /paypal/
UserMailer.upgrade_fail(params[:email]).deliver
else
UserMailer.upgrade(@user, params[:email]).deliver
end
end
private
def check_privilege(user)