Commit 2a3f5dae0f562e08436934dbc95e0f6ed6902ee9

Authored by Dmitriy Zaporozhets
1 parent 75dd7042

Fix email send on close/reopen issue. Display project name with namespace. remove css style

app/mailers/notify.rb
... ... @@ -31,6 +31,7 @@ class Notify < ActionMailer::Base
31 31 def issue_status_changed_email(recipient_id, issue_id, status, updated_by_user_id)
32 32 @issue = Issue.find issue_id
33 33 @issue_status = status
  34 + @project = @issue.project
34 35 @updated_by = User.find updated_by_user_id
35 36 mail(to: recipient(recipient_id),
36 37 subject: subject("changed issue ##{@issue.id}", @issue.title))
... ...
app/observers/issue_observer.rb
... ... @@ -16,7 +16,7 @@ class IssueObserver < ActiveRecord::Observer
16 16 if status
17 17 Note.create_status_change_note(issue, current_user, status)
18 18 [issue.author, issue.assignee].compact.each do |recipient|
19   - Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user)
  19 + Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user.id).deliver
20 20 end
21 21 end
22 22 end
... ...
app/views/layouts/notify.html.haml
... ... @@ -3,14 +3,7 @@
3 3 %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
4 4 %title
5 5 GitLab
6   - :css
7   - .header h1 {color: #BBBBBB !important; font: bold 22px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 32px;}
8   - .header p {color: #c6c6c6; font: normal 12px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 18px;}
9   - .content h2 {color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; }
10   - .content p {color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif;}
11   - .content a {color: #0eb6ce; text-decoration: none;}
12   - .footer p {font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;}
13   - .footer a {color: #0eb6ce; text-decoration: none;}
  6 +
14 7 %body{bgcolor: "#EAEAEA", style: "margin: 0; padding: 0; background: #EAEAEA"}
15 8 %table{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 35px 0; background: #EAEAEA;", width: "100%"}
16 9 %tr
... ... @@ -19,11 +12,11 @@
19 12 %tr
20 13 %td{style: "font-size: 0px;", width: "20"}
21 14
22   - %td{align: "left", style: "padding: 18px 0 10px;", width: "580"}
23   - %h1{style: "color: #BBBBBB; font: normal 22px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 32px;"}
  15 + %td{align: "left", style: "padding: 10px 0", width: "580"}
  16 + %h1{style: "font-size: 24px; color: #BBBBBB; font: normal 22px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 32px;"}
24 17 GITLAB
25 18 - if @project
26   - | #{@project.name}
  19 + → #{@project.name_with_namespace}
27 20 %table{align: "center", bgcolor: "#fff", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background: #fff;", width: "600"}
28 21 %tr= yield
29 22 %tr
... ... @@ -35,5 +28,5 @@
35 28 %p{style: "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"}
36 29 You're receiving this notification because you are a member of the
37 30 - if @project
38   - #{@project.name}
  31 + #{@project.name_with_namespace}
39 32 project team.
... ...
app/views/notify/issue_status_changed_email.html.haml
... ... @@ -9,7 +9,7 @@
9 9 %tr
10 10 %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
11 11 %td{align: "left", style: "padding: 20px 0 0;"}
12   - %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  12 + %p{style: "color:#646464 !important; line-height: 26px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; "}
13 13 = "Issue ##{@issue.id}"
14 14 = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title
15 15 %br
... ...
app/views/notify/new_issue_email.html.haml
... ... @@ -9,7 +9,7 @@
9 9 %tr
10 10 %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
11 11 %td{align: "left", style: "padding: 20px 0 0;"}
12   - %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  12 + %p{style: "color:#646464 !important; line-height: 26px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; "}
13 13 = "Issue ##{@issue.id}"
14 14 = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title
15 15 %br
... ...
app/views/notify/new_merge_request_email.html.haml
... ... @@ -5,7 +5,8 @@
5 5 %td{align: "left", style: "padding: 20px 0 0;"}
6 6 %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 = "New Merge Request !#{@merge_request.id}"
8   - = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request)
  8 + %p{style: "color:#646464 !important; line-height: 26px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; "}
  9 + = link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.project, @merge_request)
9 10 %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 11 %tr
11 12 %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
... ...
app/views/notify/project_access_granted_email.html.haml
1 1 %td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
2 2 %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
3 3 %tr
4   - %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
5   - %td{align: "left", style: "padding: 20px 0 0;"}
6   - %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
  4 + %td{width: "21"}
  5 + %td
  6 + %h2{style: "color:#646464;" }
7 7 = "You have been granted #{@users_project.project_access_human} access to project"
8 8 %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
9 9 %tr
10   - %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
11   - %td{align: "left", style: "padding: 20px 0 0;"}
12   - %h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
13   - = link_to_gfm truncate(@project.name, length: 45), project_url(@project), title: @project.name
  10 + %td{width: "21"}
  11 + %td
  12 + %h3
  13 + = link_to project_url(@project) do
  14 + = @project.name_with_namespace
14 15 %br
... ...
app/views/notify/project_was_moved_email.html.haml
... ... @@ -3,7 +3,7 @@
3 3 %tr
4 4 %td{width: "21"}
5 5 %td
6   - %h3
  6 + %h2
7 7 = "Project was moved in another location"
8 8 %td{width: "21"}
9 9 %tr
... ...
app/views/notify/reassigned_issue_email.html.haml
... ... @@ -5,7 +5,7 @@
5 5 %td{align: "left", style: "padding: 20px 0 0;"}
6 6 %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 = "Reassigned Issue ##{@issue.id}"
8   - = link_to_gfm truncate(@issue.title, length: 16), project_issue_url(@issue.project, @issue)
  8 + = link_to_gfm truncate(@issue.title, length: 30), project_issue_url(@issue.project, @issue)
9 9 %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11 11 %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
... ...
app/views/notify/reassigned_merge_request_email.html.haml
... ... @@ -5,7 +5,7 @@
5 5 %td{align: "left", style: "padding: 20px 0 0;"}
6 6 %h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
7 7 = "Reassigned Merge Request !#{@merge_request.id}"
8   - = link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request)
  8 + = link_to_gfm truncate(@merge_request.title, length: 30), project_merge_request_url(@merge_request.project, @merge_request)
9 9 %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
10 10 %tr
11 11 %td{style: "font-size: 1px; line-height: 1px;", width: "21"}
... ...