diff options
author | Anton Baklanov <antonbaklanov@gmail.com> | 2015-12-19 22:04:40 +0300 |
---|---|---|
committer | Anton Baklanov <antonbaklanov@gmail.com> | 2016-01-19 21:18:39 +0300 |
commit | 84124380e815e549f50d82051b2b546c12d9a724 (patch) | |
tree | 9d95beb6c17bb77a78cb6f25d1efeaa92d17dd8d /app/mailers/notify.rb | |
parent | 340df52bc7734ff76e75aae113313259e42680fb (diff) |
Added X-GitLab-... headers to emails from CI and Email On Push services
Fixes #2098
Diffstat (limited to 'app/mailers/notify.rb')
-rw-r--r-- | app/mailers/notify.rb | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb index e1cd075a978..8cbc9eefc7b 100644 --- a/app/mailers/notify.rb +++ b/app/mailers/notify.rb @@ -100,12 +100,7 @@ class Notify < BaseMailer end def mail_thread(model, headers = {}) - if @project - headers['X-GitLab-Project'] = @project.name - headers['X-GitLab-Project-Id'] = @project.id - headers['X-GitLab-Project-Path'] = @project.path_with_namespace - end - + add_project_headers headers["X-GitLab-#{model.class.name}-ID"] = model.id headers['X-GitLab-Reply-Key'] = reply_key @@ -152,4 +147,12 @@ class Notify < BaseMailer def reply_key @reply_key ||= SentNotification.reply_key end + + def add_project_headers + return unless @project + + headers['X-GitLab-Project'] = @project.name + headers['X-GitLab-Project-Id'] = @project.id + headers['X-GitLab-Project-Path'] = @project.path_with_namespace + end end |