diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-23 18:12:59 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-23 18:12:59 +0000 |
commit | 3acaaf7231d0779a6ceb37fca693cd81e698ef90 (patch) | |
tree | 22a068ab03faa19008997f5bc10298282ad077ab /app/mailers | |
parent | 2cba761741967eb6baf797af2ee0a702c2ffbdfe (diff) | |
download | gitlab-ce-3acaaf7231d0779a6ceb37fca693cd81e698ef90.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/profile.rb | 12 | ||||
-rw-r--r-- | app/mailers/previews/notify_preview.rb | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index 8fe471a48f2..c27e181ebd6 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -131,6 +131,18 @@ module Emails end end + def two_factor_otp_attempt_failed_email(user, ip, time = Time.current) + @user = user + @ip = ip + @time = time + + Gitlab::I18n.with_locale(@user.preferred_language) do + email_with_layout( + to: @user.notification_email_or_default, + subject: subject(_("Attempted sign in to %{host} using a wrong two-factor authentication code") % { host: Gitlab.config.gitlab.host })) + end + end + def disabled_two_factor_email(user) return unless user diff --git a/app/mailers/previews/notify_preview.rb b/app/mailers/previews/notify_preview.rb index 60a68ce97b1..15c579a7315 100644 --- a/app/mailers/previews/notify_preview.rb +++ b/app/mailers/previews/notify_preview.rb @@ -185,6 +185,10 @@ class NotifyPreview < ActionMailer::Preview Notify.unknown_sign_in_email(user, '127.0.0.1', Time.current).message end + def two_factor_otp_attempt_failed_email + Notify.two_factor_otp_attempt_failed_email(user, '127.0.0.1').message + end + def new_email_address_added_email Notify.new_email_address_added_email(user, 'someone@gitlab.com').message end |