diff options
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 |