summaryrefslogtreecommitdiff
path: root/app/mailers/emails
diff options
context:
space:
mode:
Diffstat (limited to 'app/mailers/emails')
-rw-r--r--app/mailers/emails/profile.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb
index 8fe471a48f2..65ea90d0b5d 100644
--- a/app/mailers/emails/profile.rb
+++ b/app/mailers/emails/profile.rb
@@ -94,6 +94,18 @@ module Emails
end
end
+ def access_token_revoked_email(user, token_name)
+ return unless user&.active?
+
+ @user = user
+ @token_name = token_name
+ @target_url = profile_personal_access_tokens_url
+
+ Gitlab::I18n.with_locale(@user.preferred_language) do
+ mail_with_locale(to: @user.notification_email_or_default, subject: subject(_("A personal access token has been revoked")))
+ end
+ end
+
def ssh_key_expired_email(user, fingerprints)
return unless user&.active?
@@ -131,6 +143,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