diff options
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) |