Fix email send on close/reopen issue. Display project name with namespace. remove css style
This commit is contained in:
parent
75dd704294
commit
2a3f5dae0f
|
@ -31,6 +31,7 @@ class Notify < ActionMailer::Base
|
||||||
def issue_status_changed_email(recipient_id, issue_id, status, updated_by_user_id)
|
def issue_status_changed_email(recipient_id, issue_id, status, updated_by_user_id)
|
||||||
@issue = Issue.find issue_id
|
@issue = Issue.find issue_id
|
||||||
@issue_status = status
|
@issue_status = status
|
||||||
|
@project = @issue.project
|
||||||
@updated_by = User.find updated_by_user_id
|
@updated_by = User.find updated_by_user_id
|
||||||
mail(to: recipient(recipient_id),
|
mail(to: recipient(recipient_id),
|
||||||
subject: subject("changed issue ##{@issue.id}", @issue.title))
|
subject: subject("changed issue ##{@issue.id}", @issue.title))
|
||||||
|
|
|
@ -16,7 +16,7 @@ class IssueObserver < ActiveRecord::Observer
|
||||||
if status
|
if status
|
||||||
Note.create_status_change_note(issue, current_user, status)
|
Note.create_status_change_note(issue, current_user, status)
|
||||||
[issue.author, issue.assignee].compact.each do |recipient|
|
[issue.author, issue.assignee].compact.each do |recipient|
|
||||||
Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user)
|
Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user.id).deliver
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -3,14 +3,7 @@
|
||||||
%meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
|
%meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}
|
||||||
%title
|
%title
|
||||||
GitLab
|
GitLab
|
||||||
:css
|
|
||||||
.header h1 {color: #BBBBBB !important; font: bold 22px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 32px;}
|
|
||||||
.header p {color: #c6c6c6; font: normal 12px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 18px;}
|
|
||||||
.content h2 {color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; }
|
|
||||||
.content p {color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif;}
|
|
||||||
.content a {color: #0eb6ce; text-decoration: none;}
|
|
||||||
.footer p {font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;}
|
|
||||||
.footer a {color: #0eb6ce; text-decoration: none;}
|
|
||||||
%body{bgcolor: "#EAEAEA", style: "margin: 0; padding: 0; background: #EAEAEA"}
|
%body{bgcolor: "#EAEAEA", style: "margin: 0; padding: 0; background: #EAEAEA"}
|
||||||
%table{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 35px 0; background: #EAEAEA;", width: "100%"}
|
%table{align: "center", border: "0", cellpadding: "0", cellspacing: "0", style: "padding: 35px 0; background: #EAEAEA;", width: "100%"}
|
||||||
%tr
|
%tr
|
||||||
|
@ -19,11 +12,11 @@
|
||||||
%tr
|
%tr
|
||||||
%td{style: "font-size: 0px;", width: "20"}
|
%td{style: "font-size: 0px;", width: "20"}
|
||||||
\
|
\
|
||||||
%td{align: "left", style: "padding: 18px 0 10px;", width: "580"}
|
%td{align: "left", style: "padding: 10px 0", width: "580"}
|
||||||
%h1{style: "color: #BBBBBB; font: normal 22px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 32px;"}
|
%h1{style: "font-size: 24px; color: #BBBBBB; font: normal 22px Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 32px;"}
|
||||||
GITLAB
|
GITLAB
|
||||||
- if @project
|
- if @project
|
||||||
| #{@project.name}
|
→ #{@project.name_with_namespace}
|
||||||
%table{align: "center", bgcolor: "#fff", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background: #fff;", width: "600"}
|
%table{align: "center", bgcolor: "#fff", border: "0", cellpadding: "0", cellspacing: "0", style: "font-family: Helvetica, Arial, sans-serif; background: #fff;", width: "600"}
|
||||||
%tr= yield
|
%tr= yield
|
||||||
%tr
|
%tr
|
||||||
|
@ -35,5 +28,5 @@
|
||||||
%p{style: "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"}
|
%p{style: "font-size: 11px; color:#7d7a7a; margin: 0; padding: 0; font-family: Helvetica, Arial, sans-serif;"}
|
||||||
You're receiving this notification because you are a member of the
|
You're receiving this notification because you are a member of the
|
||||||
- if @project
|
- if @project
|
||||||
#{@project.name}
|
#{@project.name_with_namespace}
|
||||||
project team.
|
project team.
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
%tr
|
%tr
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
||||||
%td{align: "left", style: "padding: 20px 0 0;"}
|
%td{align: "left", style: "padding: 20px 0 0;"}
|
||||||
%h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%p{style: "color:#646464 !important; line-height: 26px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
= "Issue ##{@issue.id}"
|
= "Issue ##{@issue.id}"
|
||||||
= link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title
|
= link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
%tr
|
%tr
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
||||||
%td{align: "left", style: "padding: 20px 0 0;"}
|
%td{align: "left", style: "padding: 20px 0 0;"}
|
||||||
%h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%p{style: "color:#646464 !important; line-height: 26px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
= "Issue ##{@issue.id}"
|
= "Issue ##{@issue.id}"
|
||||||
= link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title
|
= link_to_gfm truncate(@issue.title, length: 45), project_issue_url(@issue.project, @issue), title: @issue.title
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
%td{align: "left", style: "padding: 20px 0 0;"}
|
%td{align: "left", style: "padding: 20px 0 0;"}
|
||||||
%h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
= "New Merge Request !#{@merge_request.id}"
|
= "New Merge Request !#{@merge_request.id}"
|
||||||
= link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request)
|
%p{style: "color:#646464 !important; line-height: 26px; font-size: 16px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
|
= link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.project, @merge_request)
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
||||||
%tr
|
%tr
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
||||||
|
|
|
@ -1,14 +1,15 @@
|
||||||
%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
|
%td.content{align: "left", style: "font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;", valign: "top", width: "600"}
|
||||||
%table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
|
%table{border: "0", cellpadding: "0", cellspacing: "0", style: "color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;", width: "600"}
|
||||||
%tr
|
%tr
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{width: "21"}
|
||||||
%td{align: "left", style: "padding: 20px 0 0;"}
|
%td
|
||||||
%h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%h2{style: "color:#646464;" }
|
||||||
= "You have been granted #{@users_project.project_access_human} access to project"
|
= "You have been granted #{@users_project.project_access_human} access to project"
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
||||||
%tr
|
%tr
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{width: "21"}
|
||||||
%td{align: "left", style: "padding: 20px 0 0;"}
|
%td
|
||||||
%h2{style: "color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%h3
|
||||||
= link_to_gfm truncate(@project.name, length: 45), project_url(@project), title: @project.name
|
= link_to project_url(@project) do
|
||||||
|
= @project.name_with_namespace
|
||||||
%br
|
%br
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
%tr
|
%tr
|
||||||
%td{width: "21"}
|
%td{width: "21"}
|
||||||
%td
|
%td
|
||||||
%h3
|
%h2
|
||||||
= "Project was moved in another location"
|
= "Project was moved in another location"
|
||||||
%td{width: "21"}
|
%td{width: "21"}
|
||||||
%tr
|
%tr
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
%td{align: "left", style: "padding: 20px 0 0;"}
|
%td{align: "left", style: "padding: 20px 0 0;"}
|
||||||
%h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
= "Reassigned Issue ##{@issue.id}"
|
= "Reassigned Issue ##{@issue.id}"
|
||||||
= link_to_gfm truncate(@issue.title, length: 16), project_issue_url(@issue.project, @issue)
|
= link_to_gfm truncate(@issue.title, length: 30), project_issue_url(@issue.project, @issue)
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
||||||
%tr
|
%tr
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
%td{align: "left", style: "padding: 20px 0 0;"}
|
%td{align: "left", style: "padding: 20px 0 0;"}
|
||||||
%h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
%h2{style: "color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "}
|
||||||
= "Reassigned Merge Request !#{@merge_request.id}"
|
= "Reassigned Merge Request !#{@merge_request.id}"
|
||||||
= link_to_gfm truncate(@merge_request.title, length: 16), project_merge_request_url(@merge_request.project, @merge_request)
|
= link_to_gfm truncate(@merge_request.title, length: 30), project_merge_request_url(@merge_request.project, @merge_request)
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
||||||
%tr
|
%tr
|
||||||
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
%td{style: "font-size: 1px; line-height: 1px;", width: "21"}
|
||||||
|
|
Loading…
Reference in a new issue