Commit 306744bbb0a5e1fc6253ec9512cbae87df2a94c7

Authored by Pierre de La Morinerie
1 parent 7959455f

Simplify the default layout of notification emails

* Less margin: the content appears as the text of the message.

* Streamlined footer: everything on one line, with a small separator.

* Zimbra (www.zimbra.com) chokes on HTML tables, and doesn't display
the content of the message. Switching to a simpler layout fixes the
issue.
app/views/layouts/notify.html.haml
@@ -3,17 +3,24 @@ @@ -3,17 +3,24 @@
3 %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"} 3 %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
4 %title 4 %title
5 GitLab 5 GitLab
  6 + :css
  7 + p.details {
  8 + font-style:italic;
  9 + color:#777
  10 + }
  11 + .footer p {
  12 + font-size:small;
  13 + color:#777
  14 + }
6 15
7 %body 16 %body
8 - %table{align: "left", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 10px 0;", width: "100%"}  
9 - %tr  
10 - %td{align: "left", style: "margin: 0; padding: 10px;"}  
11 - = yield  
12 - %tr  
13 - %td{align: "left", style: "margin: 0; padding: 10px;"}  
14 - %p{style: "font-size:small;color:#777"}  
15 - - if @project  
16 - You're receiving this notification because you are a member of the #{link_to @project.name_with_namespace, project_url(@project)} project team.  
17 - %br  
18 - - if @target_url  
19 - #{link_to "View in GitLab", @target_url} 17 + %div.content
  18 + = yield
  19 + %div.footer{style: "margin-top: 10px;"}
  20 + %p
  21 + \—
  22 + %br
  23 + - if @project
  24 + You're receiving this notification because you are a member of the #{link_to @project.name_with_namespace, project_url(@project)} project team.
  25 + - if @target_url
  26 + #{link_to "View in GitLab", @target_url}
app/views/notify/new_merge_request_email.html.haml
1 -%p  
2 - = "New Merge Request ##{@merge_request.iid}"  
3 -%p 1 +%p.details
4 != merge_path_description(@merge_request, '→') 2 != merge_path_description(@merge_request, '→')
5 3
6 - if @merge_request.assignee_id.present? 4 - if @merge_request.assignee_id.present?
app/views/notify/note_merge_request_email.html.haml
1 -%p 1 +%p.details
2 - if @note.for_diff_line? 2 - if @note.for_diff_line?
3 = link_to "New comment on diff", diffs_project_merge_request_url(@merge_request.target_project, @merge_request, anchor: "note_#{@note.id}") 3 = link_to "New comment on diff", diffs_project_merge_request_url(@merge_request.target_project, @merge_request, anchor: "note_#{@note.id}")
4 - else 4 - else