summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-05-05 17:56:15 +0300
committerValery Sizov <vsv2711@gmail.com>2015-05-05 18:08:18 +0300
commit9bf4a23d8b95c2c335c52dacf0dfcd8193385a81 (patch)
tree9457fa846066eed75ab8e372085eacda753e3d8a
parentf9334fc31408520b28f7889e21f2134f3bf4514f (diff)
downloadgitlab-ci-9bf4a23d8b95c2c335c52dacf0dfcd8193385a81.tar.gz
Improved email templates
-rw-r--r--CHANGELOG1
-rw-r--r--app/mailers/notify.rb1
-rw-r--r--app/views/notify/build_fail_email.html.haml8
-rw-r--r--app/views/notify/build_success_email.html.haml8
-rw-r--r--spec/mailers/notify_spec.rb4
5 files changed, 10 insertions, 12 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 0588659..55e938f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -9,6 +9,7 @@ v7.11.0
- Add a GitLab project path parameter to the project API
- Remove projects IDs from dashboard
- UI fix: Remove page headers from the admin area
+ - Improve Email templates
v7.10.1
- Fix failing migration when update to 7.10 from 7.8 and older versions
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index cf63ec4..1107369 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -2,6 +2,7 @@ class Notify < ActionMailer::Base
include Emails::Builds
add_template_helper ApplicationHelper
+ add_template_helper GitlabHelper
default_url_options[:host] = GitlabCi.config.gitlab_ci.host
default_url_options[:protocol] = GitlabCi.config.gitlab_ci.protocol
diff --git a/app/views/notify/build_fail_email.html.haml b/app/views/notify/build_fail_email.html.haml
index fc1f7e1..7c24551 100644
--- a/app/views/notify/build_fail_email.html.haml
+++ b/app/views/notify/build_fail_email.html.haml
@@ -2,14 +2,12 @@
%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 CI (build failed)
%h3
- Build failed for
+ Project:
= link_to project_url(@project) do
= @project.name
%p
- Status: #{@build.status}
-%p
- Commit: #{@build.commit.short_sha}
+ Commit link: #{gitlab_commit_link(@project, @build.commit.short_sha)}
%p
Author: #{@build.commit.git_author_name}
%p
@@ -18,4 +16,4 @@
Message: #{@build.commit.git_commit_message}
%p
- Url: #{link_to @build.short_sha, project_build_url(@build.project, @build)}
+ Url: #{link_to @build.short_sha, project_build_url(@project, @build)}
diff --git a/app/views/notify/build_success_email.html.haml b/app/views/notify/build_success_email.html.haml
index 1ae293d..a9fae31 100644
--- a/app/views/notify/build_success_email.html.haml
+++ b/app/views/notify/build_success_email.html.haml
@@ -3,14 +3,12 @@
GitLab CI (build successful)
%h3
- Build successful for
+ Project:
= link_to project_url(@project) do
= @project.name
%p
- Status: #{@build.status}
-%p
- Commit: #{@build.commit.short_sha}
+ Commit link: #{gitlab_commit_link(@project, @build.commit.short_sha)}
%p
Author: #{@build.commit.git_author_name}
%p
@@ -19,4 +17,4 @@
Message: #{@build.commit.git_commit_message}
%p
- Url: #{link_to @build.short_sha, project_build_url(@build.project, @build)}
+ Url: #{link_to @build.short_sha, project_build_url(@project, @build)}
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index 81aaa27..6a2c845 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -18,7 +18,7 @@ describe Notify do
end
it 'contains name of project' do
- should have_body_text /Build successful/
+ should have_body_text /build successful/
end
end
@@ -30,7 +30,7 @@ describe Notify do
end
it 'contains name of project' do
- should have_body_text /Build failed/
+ should have_body_text /build failed/
end
end
end