Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-08-31 16:38:02 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-08-31 20:20:24 +0300
commit1bd2327c314ca8d5782298e80443c0fbbba0b66a (patch)
tree71b5d99b59e9306c6be1f96dd817f915ee0b3d09 /app/mailers
parent0997cfd750070f6fb4b821d5982594fc3ddb13e8 (diff)
Add mock email templates
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/pipelines.rb17
1 files changed, 8 insertions, 9 deletions
diff --git a/app/mailers/emails/pipelines.rb b/app/mailers/emails/pipelines.rb
index 48bfc974768..7c181d2e366 100644
--- a/app/mailers/emails/pipelines.rb
+++ b/app/mailers/emails/pipelines.rb
@@ -11,28 +11,27 @@ module Emails
private
def pipeline_mail(params, to, status)
- @params = params
+ @project = params.project
+ @pipeline = params.pipeline
add_headers
mail(to: to, subject: pipeline_subject(status))
end
def add_headers
- @project = @params.project # `add_project_headers` needs this
add_project_headers
- add_pipeline_headers(@params.pipeline)
+ add_pipeline_headers
end
- def add_pipeline_headers(pipeline)
- headers['X-GitLab-Pipeline-Id'] = pipeline.id
- headers['X-GitLab-Pipeline-Ref'] = pipeline.ref
- headers['X-GitLab-Pipeline-Status'] = pipeline.status
+ def add_pipeline_headers
+ headers['X-GitLab-Pipeline-Id'] = @pipeline.id
+ headers['X-GitLab-Pipeline-Ref'] = @pipeline.ref
+ headers['X-GitLab-Pipeline-Status'] = @pipeline.status
end
def pipeline_subject(status)
subject(
- "Pipeline #{status} for #{@params.project.name}",
- @params.pipeline.short_sha)
+ "Pipeline #{status} for #{@project.name}", @pipeline.short_sha)
end
end
end