forked from External/greenlight
GRN2-140: Added Email to inform user they've been promoted (#534)
* Added Email to inform user they've been promoted * Update user_mailer.rb * Send email when a user is demoted * Change more-info string
This commit is contained in:
committed by
Jesus Federico
parent
9638ebcbc5
commit
83a9edf81d
@ -48,12 +48,18 @@ class AdminsController < ApplicationController
|
||||
# POST /admins/promote/:user_uid
|
||||
def promote
|
||||
@user.add_role :admin
|
||||
|
||||
send_user_promoted_email(@user)
|
||||
|
||||
redirect_to admins_path, flash: { success: I18n.t("administrator.flash.promoted") }
|
||||
end
|
||||
|
||||
# POST /admins/demote/:user_uid
|
||||
def demote
|
||||
@user.remove_role :admin
|
||||
|
||||
send_user_demoted_email(@user)
|
||||
|
||||
redirect_to admins_path, flash: { success: I18n.t("administrator.flash.demoted") }
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user