diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-13 03:08:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-05-13 03:08:26 +0000 |
commit | 2fc7740f3ca1ca5e5a88f9f4136d631f7650bac7 (patch) | |
tree | 7cf264cf713a0372160954b055d5b27227e5e375 /app/mailers | |
parent | 8dc1e72e2b5cb6112d5468194580edb186de4659 (diff) | |
download | gitlab-ce-2fc7740f3ca1ca5e5a88f9f4136d631f7650bac7.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/profile.rb | 10 | ||||
-rw-r--r-- | app/mailers/previews/notify_preview.rb | 4 |
2 files changed, 14 insertions, 0 deletions
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index 441439444d5..4b19149a833 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -44,6 +44,16 @@ module Emails mail(to: @user.notification_email, subject: subject(_("Your Personal Access Tokens will expire in %{days_to_expire} days or less") % { days_to_expire: @days_to_expire })) end end + + def unknown_sign_in_email(user, ip) + @user = user + @ip = ip + @target_url = edit_profile_password_url + + Gitlab::I18n.with_locale(@user.preferred_language) do + mail(to: @user.notification_email, subject: subject(_("Unknown sign-in from new location"))) + end + end end end diff --git a/app/mailers/previews/notify_preview.rb b/app/mailers/previews/notify_preview.rb index 38e1d9532a6..c931b5a848f 100644 --- a/app/mailers/previews/notify_preview.rb +++ b/app/mailers/previews/notify_preview.rb @@ -161,6 +161,10 @@ class NotifyPreview < ActionMailer::Preview Notify.remote_mirror_update_failed_email(remote_mirror.id, user.id).message end + def unknown_sign_in_email + Notify.unknown_sign_in_email(user, '127.0.0.1').message + end + private def project |