diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2016-08-31 21:38:02 +0800 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2016-09-01 01:20:24 +0800 |
commit | 1bd2327c314ca8d5782298e80443c0fbbba0b66a (patch) | |
tree | 71b5d99b59e9306c6be1f96dd817f915ee0b3d09 /app/mailers | |
parent | 0997cfd750070f6fb4b821d5982594fc3ddb13e8 (diff) | |
download | gitlab-ce-1bd2327c314ca8d5782298e80443c0fbbba0b66a.tar.gz |
Add mock email templates
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/emails/pipelines.rb | 17 |
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 |