summaryrefslogtreecommitdiff
path: root/lib/gitlab/email/handler/unsubscribe_handler.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/email/handler/unsubscribe_handler.rb')
-rw-r--r--lib/gitlab/email/handler/unsubscribe_handler.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/email/handler/unsubscribe_handler.rb b/lib/gitlab/email/handler/unsubscribe_handler.rb
index 97d7a8d65ff..5894384da5d 100644
--- a/lib/gitlab/email/handler/unsubscribe_handler.rb
+++ b/lib/gitlab/email/handler/unsubscribe_handler.rb
@@ -4,6 +4,8 @@ module Gitlab
module Email
module Handler
class UnsubscribeHandler < BaseHandler
+ delegate :project, to: :sent_notification, allow_nil: true
+
def can_handle?
mail_key =~ /\A\w+#{Regexp.escape(Gitlab::IncomingEmail::UNSUBSCRIBE_SUFFIX)}\z/
end
@@ -17,6 +19,10 @@ module Gitlab
noteable.unsubscribe(sent_notification.recipient)
end
+ def metrics_params
+ super.merge(project: project&.full_path)
+ end
+
private
def sent_notification