diff options
| author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-02-11 15:08:10 +0100 |
|---|---|---|
| committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2016-02-12 14:01:27 +0100 |
| commit | c9f202b2efdecda2e9fa5290ba5de413ab345a7d (patch) | |
| tree | bc9dd9fe972d1ea34aa19c3e08307daed18ad8f0 /app | |
| parent | b1dda8145433f15fcea683451c9c79927b19352e (diff) | |
| download | gitlab-ce-c9f202b2efdecda2e9fa5290ba5de413ab345a7d.tar.gz | |
Fix broken link in CI build notification emails
Closes #13199
Diffstat (limited to 'app')
| -rw-r--r-- | app/mailers/emails/builds.rb | 13 | ||||
| -rw-r--r-- | app/views/notify/build_fail_email.html.haml | 3 | ||||
| -rw-r--r-- | app/views/notify/build_success_email.html.haml | 2 |
3 files changed, 10 insertions, 8 deletions
diff --git a/app/mailers/emails/builds.rb b/app/mailers/emails/builds.rb index 64c1ce8cfab..2f86d1be576 100644 --- a/app/mailers/emails/builds.rb +++ b/app/mailers/emails/builds.rb @@ -3,26 +3,27 @@ module Emails def build_fail_email(build_id, to) @build = Ci::Build.find(build_id) @project = @build.project + add_project_headers - add_build_headers - headers['X-GitLab-Build-Status'] = "failed" + add_build_headers('failed') mail(to: to, subject: subject("Build failed for #{@project.name}", @build.short_sha)) end def build_success_email(build_id, to) @build = Ci::Build.find(build_id) @project = @build.project + add_project_headers - add_build_headers - headers['X-GitLab-Build-Status'] = "success" + add_build_headers('success') mail(to: to, subject: subject("Build success for #{@project.name}", @build.short_sha)) end private - def add_build_headers + + def add_build_headers(status) headers['X-GitLab-Build-Id'] = @build.id headers['X-GitLab-Build-Ref'] = @build.ref + headers['X-GitLab-Build-Status'] = status.to_s end - end end diff --git a/app/views/notify/build_fail_email.html.haml b/app/views/notify/build_fail_email.html.haml index f4e9749e5c7..81d65037312 100644 --- a/app/views/notify/build_fail_email.html.haml +++ b/app/views/notify/build_fail_email.html.haml @@ -1,9 +1,10 @@ - content_for :header do %h1{style: "background: #c40834; color: #FFF; font: normal 20px Helvetica, Arial, sans-serif; margin: 0; padding: 5px 10px; line-height: 32px; font-size: 16px;"} GitLab (build failed) + %h3 Project: - = link_to ci_project_url(@project) do + = link_to namespace_project_url(@project.namespace, @project) do = @project.name %p diff --git a/app/views/notify/build_success_email.html.haml b/app/views/notify/build_success_email.html.haml index 8b004d34cca..5d247eb4cf2 100644 --- a/app/views/notify/build_success_email.html.haml +++ b/app/views/notify/build_success_email.html.haml @@ -4,7 +4,7 @@ %h3 Project: - = link_to ci_project_url(@project) do + = link_to namespace_project_url(@project.namespace, @project) do = @project.name %p |
