8cce70730c
* new merge request can be created by sending an email to the specific email address (similar to creating issues by email) * for the first iteration, source branch must be specified in the mail subject, other merge request parameters can not be set yet * user should enable "Receive notifications about your own activity" in user settings to receive a notification about created merge request Part of #32878
24 lines
616 B
Ruby
24 lines
616 B
Ruby
require 'gitlab/email/handler/create_merge_request_handler'
|
|
require 'gitlab/email/handler/create_note_handler'
|
|
require 'gitlab/email/handler/create_issue_handler'
|
|
require 'gitlab/email/handler/unsubscribe_handler'
|
|
|
|
module Gitlab
|
|
module Email
|
|
module Handler
|
|
HANDLERS = [
|
|
UnsubscribeHandler,
|
|
CreateNoteHandler,
|
|
CreateMergeRequestHandler,
|
|
CreateIssueHandler
|
|
].freeze
|
|
|
|
def self.for(mail, mail_key)
|
|
HANDLERS.find do |klass|
|
|
handler = klass.new(mail, mail_key)
|
|
break handler if handler.can_handle?
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|