Class: Gitlab::Email::Handler::CreateNoteHandler
Constant Summary
collapse
- HANDLER_REGEX =
/\A#{::SentNotification::FULL_REPLY_KEY_REGEX}\z/
Constants inherited
from BaseHandler
BaseHandler::HANDLER_ACTION_BASE_REGEX
Instance Attribute Summary
Attributes inherited from BaseHandler
#mail, #mail_key
Instance Method Summary
collapse
#project
Methods inherited from BaseHandler
#initialize, #metrics_params
Instance Method Details
#can_handle? ⇒ Boolean
20
21
22
|
# File 'lib/gitlab/email/handler/create_note_handler.rb', line 20
def can_handle?
mail_key =~ HANDLER_REGEX
end
|
#execute ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# File 'lib/gitlab/email/handler/create_note_handler.rb', line 24
def execute
raise SentNotificationNotFoundError unless sent_notification
validate_permission!(:create_note)
validate_from_address!
raise NoteableNotFoundError unless noteable
raise EmptyEmailError if note_message.blank?
verify_record!(
record: create_note,
invalid_exception: InvalidNoteError,
record_name: 'comment')
reopen_issue_on_external_participant_note
end
|
#metrics_event ⇒ Object
42
43
44
|
# File 'lib/gitlab/email/handler/create_note_handler.rb', line 42
def metrics_event
:receive_email_create_note
end
|