Store projects in metrics for email replies
This commit is contained in:
parent
57edc23385
commit
19970e1dba
|
@ -7,6 +7,8 @@ module Gitlab
|
||||||
class CreateNoteHandler < BaseHandler
|
class CreateNoteHandler < BaseHandler
|
||||||
include ReplyProcessing
|
include ReplyProcessing
|
||||||
|
|
||||||
|
delegate :project, to: :sent_notification, allow_nil: true
|
||||||
|
|
||||||
def can_handle?
|
def can_handle?
|
||||||
mail_key =~ /\A\w+\z/
|
mail_key =~ /\A\w+\z/
|
||||||
end
|
end
|
||||||
|
@ -32,10 +34,6 @@ module Gitlab
|
||||||
sent_notification.recipient
|
sent_notification.recipient
|
||||||
end
|
end
|
||||||
|
|
||||||
def project
|
|
||||||
sent_notification.project
|
|
||||||
end
|
|
||||||
|
|
||||||
def sent_notification
|
def sent_notification
|
||||||
@sent_notification ||= SentNotification.for(mail_key)
|
@sent_notification ||= SentNotification.for(mail_key)
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,6 +4,8 @@ module Gitlab
|
||||||
module Email
|
module Email
|
||||||
module Handler
|
module Handler
|
||||||
class UnsubscribeHandler < BaseHandler
|
class UnsubscribeHandler < BaseHandler
|
||||||
|
delegate :project, to: :sent_notification, allow_nil: true
|
||||||
|
|
||||||
def can_handle?
|
def can_handle?
|
||||||
mail_key =~ /\A\w+#{Regexp.escape(Gitlab::IncomingEmail::UNSUBSCRIBE_SUFFIX)}\z/
|
mail_key =~ /\A\w+#{Regexp.escape(Gitlab::IncomingEmail::UNSUBSCRIBE_SUFFIX)}\z/
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue