Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c5789b87
Commit
c5789b87
authored
Mar 10, 2021
by
David Kim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add reviewer information to new_mention_in_merge_request_email
- it also fixes broken assignees_label
parent
abb7fc8f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
app/mailers/previews/notify_preview.rb
app/mailers/previews/notify_preview.rb
+4
-0
app/views/notify/new_mention_in_merge_request_email.text.erb
app/views/notify/new_mention_in_merge_request_email.text.erb
+2
-1
changelogs/unreleased/300750-add-missing-reviewers-information-to-new_mention_in_merge_request_.yml
...eviewers-information-to-new_mention_in_merge_request_.yml
+5
-0
spec/mailers/emails/merge_requests_spec.rb
spec/mailers/emails/merge_requests_spec.rb
+17
-0
No files found.
app/mailers/previews/notify_preview.rb
View file @
c5789b87
...
@@ -60,6 +60,10 @@ class NotifyPreview < ActionMailer::Preview
...
@@ -60,6 +60,10 @@ class NotifyPreview < ActionMailer::Preview
end
end
end
end
def
new_mention_in_merge_request_email
Notify
.
new_mention_in_merge_request_email
(
user
.
id
,
issue
.
id
,
user
.
id
).
message
end
def
closed_issue_email
def
closed_issue_email
Notify
.
closed_issue_email
(
user
.
id
,
issue
.
id
,
user
.
id
).
message
Notify
.
closed_issue_email
(
user
.
id
,
issue
.
id
,
user
.
id
).
message
end
end
...
...
app/views/notify/new_mention_in_merge_request_email.text.erb
View file @
c5789b87
...
@@ -4,6 +4,7 @@ You have been mentioned in Merge Request <%= @merge_request.to_reference %>
...
@@ -4,6 +4,7 @@ You have been mentioned in Merge Request <%= @merge_request.to_reference %>
<%=
merge_path_description
(
@merge_request
,
'to'
)
%>
<%=
merge_path_description
(
@merge_request
,
'to'
)
%>
Author:
<%=
sanitize_name
(
@merge_request
.
author_name
)
%>
Author:
<%=
sanitize_name
(
@merge_request
.
author_name
)
%>
= assignees_label(@merge_request)
<%=
assignees_label
(
@merge_request
)
%>
<%=
reviewers_label
(
@merge_request
)
%>
<%=
@merge_request
.
description
%>
<%=
@merge_request
.
description
%>
changelogs/unreleased/300750-add-missing-reviewers-information-to-new_mention_in_merge_request_.yml
0 → 100644
View file @
c5789b87
---
title
:
Add reviewers detail to new mention in merge request email
merge_request
:
56184
author
:
type
:
added
spec/mailers/emails/merge_requests_spec.rb
View file @
c5789b87
...
@@ -24,6 +24,23 @@ RSpec.describe Emails::MergeRequests do
...
@@ -24,6 +24,23 @@ RSpec.describe Emails::MergeRequests do
let
(
:recipient
)
{
assignee
}
let
(
:recipient
)
{
assignee
}
let
(
:current_user_sanitized
)
{
'www_example_com'
}
let
(
:current_user_sanitized
)
{
'www_example_com'
}
describe
'#new_mention_in_merge_request_email'
do
subject
{
Notify
.
new_mention_in_merge_request_email
(
recipient
.
id
,
merge_request
.
id
,
current_user
.
id
)
}
it
'has the correct subject and body'
do
aggregate_failures
do
is_expected
.
to
have_referable_subject
(
merge_request
,
reply:
true
)
is_expected
.
to
have_body_text
(
project_merge_request_path
(
project
,
merge_request
))
is_expected
.
to
have_body_text
(
'You have been mentioned in Merge Request'
)
is_expected
.
to
have_link
(
merge_request
.
to_reference
,
href:
project_merge_request_url
(
merge_request
.
target_project
,
merge_request
))
is_expected
.
to
have_text_part_content
(
assignee
.
name
)
is_expected
.
to
have_text_part_content
(
reviewer
.
name
)
is_expected
.
to
have_html_part_content
(
assignee
.
name
)
is_expected
.
to
have_html_part_content
(
reviewer
.
name
)
end
end
end
describe
'#merge_request_unmergeable_email'
do
describe
'#merge_request_unmergeable_email'
do
subject
{
Notify
.
merge_request_unmergeable_email
(
recipient
.
id
,
merge_request
.
id
)
}
subject
{
Notify
.
merge_request_unmergeable_email
(
recipient
.
id
,
merge_request
.
id
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment