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/services/notification_service.rb | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'app/services/notification_service.rb')
-rw-r--r-- | app/services/notification_service.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 5b1733422d0..aa7e636b8a4 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -18,6 +18,7 @@ class NotificationService class Async attr_reader :parent + delegate :respond_to_missing, to: :parent def initialize(parent) @@ -64,6 +65,13 @@ class NotificationService end end + # Notify the owner of the account when a new personal access token is created + def access_token_created(user, token_name) + return unless user.can?(:receive_notifications) + + mailer.access_token_created_email(user, token_name).deliver_later + end + # Notify the owner of the personal access token, when it is about to expire # And mark the token with about_to_expire_delivered def access_token_about_to_expire(user, token_names) |