diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /app/mailers | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/application_mailer.rb | 1 | ||||
-rw-r--r-- | app/mailers/emails/profile.rb | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index e0c95370072..94ed83a7d4a 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -7,6 +7,7 @@ class ApplicationMailer < ActionMailer::Base helper MarkupHelper attr_accessor :current_user + helper_method :current_user, :can? default from: proc { default_sender_address.format } diff --git a/app/mailers/emails/profile.rb b/app/mailers/emails/profile.rb index 592c394bb48..28e51ba311b 100644 --- a/app/mailers/emails/profile.rb +++ b/app/mailers/emails/profile.rb @@ -58,6 +58,18 @@ module Emails end # rubocop: enable CodeReuse/ActiveRecord + def access_token_created_email(user, token_name) + return unless user&.active? + + @user = user + @target_url = profile_personal_access_tokens_url + @token_name = token_name + + Gitlab::I18n.with_locale(@user.preferred_language) do + mail(to: @user.notification_email_or_default, subject: subject(_("A new personal access token has been created"))) + end + end + def access_token_about_to_expire_email(user, token_names) return unless user |