Commit 2a3f5dae0f562e08436934dbc95e0f6ed6902ee9
1 parent
75dd7042
Exists in
master
and in
4 other branches
Fix email send on close/reopen issue. Display project name with namespace. remove css style
Showing
10 changed files
with
22 additions
and
26 deletions
Show diff stats
app/mailers/notify.rb
@@ -31,6 +31,7 @@ class Notify < ActionMailer::Base | @@ -31,6 +31,7 @@ class Notify < ActionMailer::Base | ||
31 | def issue_status_changed_email(recipient_id, issue_id, status, updated_by_user_id) | 31 | def issue_status_changed_email(recipient_id, issue_id, status, updated_by_user_id) |
32 | @issue = Issue.find issue_id | 32 | @issue = Issue.find issue_id |
33 | @issue_status = status | 33 | @issue_status = status |
34 | + @project = @issue.project | ||
34 | @updated_by = User.find updated_by_user_id | 35 | @updated_by = User.find updated_by_user_id |
35 | mail(to: recipient(recipient_id), | 36 | mail(to: recipient(recipient_id), |
36 | subject: subject("changed issue ##{@issue.id}", @issue.title)) | 37 | subject: subject("changed issue ##{@issue.id}", @issue.title)) |
app/observers/issue_observer.rb
@@ -16,7 +16,7 @@ class IssueObserver < ActiveRecord::Observer | @@ -16,7 +16,7 @@ class IssueObserver < ActiveRecord::Observer | ||
16 | if status | 16 | if status |
17 | Note.create_status_change_note(issue, current_user, status) | 17 | Note.create_status_change_note(issue, current_user, status) |
18 | [issue.author, issue.assignee].compact.each do |recipient| | 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 | end | 20 | end |
21 | end | 21 | end |
22 | end | 22 | end |
app/views/layouts/notify.html.haml
@@ -3,14 +3,7 @@ | @@ -3,14 +3,7 @@ | ||
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 | - .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 | %body{bgcolor: "#EAEAEA", style: "margin: 0; padding: 0; background: #EAEAEA"} | 7 | %body{bgcolor: "#EAEAEA", style: "margin: 0; padding: 0; background: #EAEAEA"} |
15 | %table{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 35px 0; background: #EAEAEA;", width: "100%"} | 8 | %table{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 35px 0; background: #EAEAEA;", width: "100%"} |
16 | %tr | 9 | %tr |
@@ -19,11 +12,11 @@ | @@ -19,11 +12,11 @@ | ||
19 | %tr | 12 | %tr |
20 | %td{style: "font-size: 0px;", width: "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 | GITLAB | 17 | GITLAB |
25 | - if @project | 18 | - if @project |
26 | - | #{@project.name} | 19 | + → #{@project.name_with_namespace} |
27 | %table{align: "center", bgcolor: "#fff", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background: #fff;", width: "600"} | 20 | %table{align: "center", bgcolor: "#fff", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background: #fff;", width: "600"} |
28 | %tr= yield | 21 | %tr= yield |
29 | %tr | 22 | %tr |
@@ -35,5 +28,5 @@ | @@ -35,5 +28,5 @@ | ||
35 | %p{style: "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"} | 28 | %p{style: "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"} |
36 | You're receiving this notification because you are a member of the | 29 | You're receiving this notification because you are a member of the |
37 | - if @project | 30 | - if @project |
38 | - #{@project.name} | 31 | + #{@project.name_with_namespace} |
39 | project team. | 32 | project team. |
app/views/notify/issue_status_changed_email.html.haml
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | %tr | 9 | %tr |
10 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | 10 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
11 | %td{align: "left", style: "padding: 20px 0 0;"} | 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 | = "Issue ##{@issue.id}" | 13 | = "Issue ##{@issue.id}" |
14 | = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title | 14 | = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title |
15 | %br | 15 | %br |
app/views/notify/new_issue_email.html.haml
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | %tr | 9 | %tr |
10 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | 10 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
11 | %td{align: "left", style: "padding: 20px 0 0;"} | 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 | = "Issue ##{@issue.id}" | 13 | = "Issue ##{@issue.id}" |
14 | = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title | 14 | = link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title |
15 | %br | 15 | %br |
app/views/notify/new_merge_request_email.html.haml
@@ -5,7 +5,8 @@ | @@ -5,7 +5,8 @@ | ||
5 | %td{align: "left", style: "padding: 20px 0 0;"} | 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; "} | 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 | = "New Merge Request !#{@merge_request.id}" | 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 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | 10 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
10 | %tr | 11 | %tr |
11 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | 12 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
app/views/notify/project_access_granted_email.html.haml
1 | %td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} | 1 | %td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"} |
2 | %table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"} | 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 | %tr | 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 | = "You have been granted #{@users_project.project_access_human} access to project" | 7 | = "You have been granted #{@users_project.project_access_human} access to project" |
8 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | 8 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
9 | %tr | 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 | %br | 15 | %br |
app/views/notify/project_was_moved_email.html.haml
app/views/notify/reassigned_issue_email.html.haml
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | %td{align: "left", style: "padding: 20px 0 0;"} | 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; "} | 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 | = "Reassigned Issue ##{@issue.id}" | 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 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | 9 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
10 | %tr | 10 | %tr |
11 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | 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,7 +5,7 @@ | ||
5 | %td{align: "left", style: "padding: 20px 0 0;"} | 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; "} | 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 | = "Reassigned Merge Request !#{@merge_request.id}" | 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 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | 9 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |
10 | %tr | 10 | %tr |
11 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} | 11 | %td{style: "font-size: 1px; line-height: 1px;", width: "21"} |