diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-19 08:27:35 +0000 |
commit | 7e9c479f7de77702622631cff2628a9c8dcbc627 (patch) | |
tree | c8f718a08e110ad7e1894510980d2155a6549197 /app/mailers/emails/profile.rb | |
parent | e852b0ae16db4052c1c567d9efa4facc81146e88 (diff) | |
download | gitlab-ce-0bddc398e06691ecd2db73d0c570a122a6585fe8.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-eev13.6.0-rc42
Diffstat (limited to 'app/mailers/emails/profile.rb')
-rw-r--r-- | app/mailers/emails/profile.rb | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index 96cf3571968..6f44b63f8d0 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -9,6 +9,15 @@ module Emails mail(to: @user.notification_email, subject: subject("Account was created for you")) end + def instance_access_request_email(user, recipient) + @user = user + @recipient = recipient + + profile_email_with_layout( + to: recipient.notification_email, + subject: subject(_("GitLab Account Request"))) + end + # rubocop: disable CodeReuse/ActiveRecord def new_ssh_key_email(key_id) @key = Key.find_by(id: key_id) @@ -63,13 +72,9 @@ module Emails @target_url = edit_profile_password_url Gitlab::I18n.with_locale(@user.preferred_language) do - mail( + profile_email_with_layout( to: @user.notification_email, - subject: subject(_("%{host} sign-in from new location") % { host: Gitlab.config.gitlab.host }) - ) do |format| - format.html { render layout: 'mailer' } - format.text { render layout: 'mailer' } - end + subject: subject(_("%{host} sign-in from new location") % { host: Gitlab.config.gitlab.host })) end end @@ -82,6 +87,15 @@ module Emails mail(to: @user.notification_email, subject: subject(_("Two-factor authentication disabled"))) end end + + private + + def profile_email_with_layout(to:, subject:, layout: 'mailer') + mail(to: to, subject: subject) do |format| + format.html { render layout: layout } + format.text { render layout: layout } + end + end end end |