Commit b4ee4c56 authored by sfang97's avatar sfang97 Committed by serenafang

Send user email on rejection

Start building out email sending and admin views
parent f8dcbdd1
...@@ -17,6 +17,10 @@ class DeviseMailer < Devise::Mailer ...@@ -17,6 +17,10 @@ class DeviseMailer < Devise::Mailer
devise_mail(record, :user_admin_approval, opts) devise_mail(record, :user_admin_approval, opts)
end end
def user_admin_rejection(record, opts = {})
devise_mail(record, :user_admin_rejection, opts)
end
protected protected
def subject_for(key) def subject_for(key)
......
...@@ -28,6 +28,10 @@ class DeviseMailerPreview < ActionMailer::Preview ...@@ -28,6 +28,10 @@ class DeviseMailerPreview < ActionMailer::Preview
DeviseMailer.user_admin_approval(unsaved_user, {}) DeviseMailer.user_admin_approval(unsaved_user, {})
end end
def user_admin_rejection
DeviseMailer.user_admin_rejection(unsaved_user, {})
end
private private
def unsaved_user def unsaved_user
......
.card.border-danger
.card-header.bg-danger.gl-text-white
= s_('AdminUsers|This user has requested access')
.card-body
= render partial: 'admin/users/user_reject_effects'
%br
= link_to s_('AdminUsers|Reject request'), approve_admin_user_path(user), method: :put, class: "btn delete-user-button gl-button btn-danger", data: { delete: s_('AdminUsers|Are you sure?') }
%p
= s_('AdminUsers|If you reject the user:')
%ul
%li
= s_('AdminUsers|The user can not sign in or access instance information.')
%li
= s_('AdminUsers|The user will be deleted.')
%p
- link_start = '<a href="%{url}">'.html_safe % { url: help_page_path("user/profile/account/delete_account", anchor: "associated-records") }
= _('For more information, please refer to the %{link_start}user account deletion documentation.%{link_end}').html_safe % { link_start: link_start, link_end: '</a>'.html_safe }
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
- if @user.blocked? - if @user.blocked?
- if @user.blocked_pending_approval? - if @user.blocked_pending_approval?
= render 'admin/users/approve_user', user: @user = render 'admin/users/approve_user', user: @user
= render 'admin/users/block_user', user: @user = render 'admin/users/reject_user', user: @user
- else - else
.card.border-info .card.border-info
.card-header.gl-bg-blue-500.gl-text-white .card-header.gl-bg-blue-500.gl-text-white
......
= email_default_heading(say_hi(@resource))
%p
= _('Your request to join host fix this has been rejected.')
%p
= _('Please contact your GitLab administrator if you think this is an error.')
<%= say_hi(@resource) %>
<%= _('Your request to join host fix this has been rejected.') %>
<%= _('Please contact your GitLab administrator if you think this is an error.') %>
...@@ -32,6 +32,8 @@ en: ...@@ -32,6 +32,8 @@ en:
subject: "Password changed by administrator" subject: "Password changed by administrator"
user_admin_approval: user_admin_approval:
subject: "Welcome to GitLab!" subject: "Welcome to GitLab!"
user_admin_rejection:
subject: "GitLab account request rejected"
omniauth_callbacks: omniauth_callbacks:
failure: "Could not authenticate you from %{kind} because \"%{reason}\"." failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
success: "Successfully authenticated from %{kind} account." success: "Successfully authenticated from %{kind} account."
......
...@@ -20325,6 +20325,9 @@ msgstr "" ...@@ -20325,6 +20325,9 @@ msgstr ""
msgid "Please complete your profile with email address" msgid "Please complete your profile with email address"
msgstr "" msgstr ""
msgid "Please contact your GitLab administrator if you think this is an error."
msgstr ""
msgid "Please contact your administrator with any questions." msgid "Please contact your administrator with any questions."
msgstr "" msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment