gitlab-org--gitlab-foss/lib/gitlab/email/handler.rb
Jan Provaznik 8cce70730c Create merge request from email
* 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
2017-12-05 08:41:58 +01:00

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