diff options
author | Jan Provaznik <jprovaznik@gitlab.com> | 2017-08-24 09:20:36 +0300 |
---|---|---|
committer | Jan Provaznik <jan.provaznik@gmail.com> | 2017-12-05 10:41:58 +0300 |
commit | 8cce70730c2fb9c705e1f1177f6d1effc665b3c7 (patch) | |
tree | 658e5a0f245159944f7aefc8155627c29b918d1d /app/models | |
parent | a1cd9be42910c89192e82659c09bf0242c8e5dae (diff) |
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
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/project.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 0a7e7617d9b..cc530076bf7 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -752,13 +752,14 @@ class Project < ActiveRecord::Base Gitlab::Routing.url_helpers.project_url(self) end - def new_issue_address(author) + def new_issuable_address(author, address_type) return unless Gitlab::IncomingEmail.supports_issue_creation? && author author.ensure_incoming_email_token! + suffix = address_type == 'merge_request' ? '+merge-request' : '' Gitlab::IncomingEmail.reply_address( - "#{full_path}+#{author.incoming_email_token}") + "#{full_path}#{suffix}+#{author.incoming_email_token}") end def build_commit_note(commit) |