Commit 11d8fb9f authored by Kerri Miller's avatar Kerri Miller

Merge branch 'hchouraria-notify-email-html-link-to-mr-on-top-fixed' into 'master'

Add link to merge request in email

See merge request gitlab-org/gitlab!56064
parents e7960aa6 db5b521a
......@@ -84,6 +84,10 @@ class NotifyPreview < ActionMailer::Preview
Notify.issues_csv_email(user, project, '1997,Ford,E350', { truncated: false, rows_expected: 3, rows_written: 3 }).message
end
def new_merge_request_email
Notify.new_merge_request_email(user.id, merge_request.id).message
end
def closed_merge_request_email
Notify.closed_merge_request_email(user.id, issue.id, user.id).message
end
......
%p.details
#{link_to @merge_request.author_name, user_url(@merge_request.author)} created a merge request:
= html_escape(_('%{userLinkStart}%{user}%{linkEnd} created a %{mrLinkStart}merge request%{linkEnd}:')) % {userLinkStart: "<a href=\"#{user_url(@merge_request.author)}\">".html_safe,
user: @merge_request.author_name,
mrLinkStart: "<a href=\"#{@target_url}\">".html_safe,
linkEnd: '</a>'.html_safe}
%p
.branch
......
---
title: Link to the merge request in its creation email notification
merge_request: 56064
author:
type: other
......@@ -935,6 +935,9 @@ msgstr ""
msgid "%{usage_ping_link_start}Learn more%{usage_ping_link_end} about what information is shared with GitLab Inc."
msgstr ""
msgid "%{userLinkStart}%{user}%{linkEnd} created a %{mrLinkStart}merge request%{linkEnd}:"
msgstr ""
msgid "%{userName} (cannot merge)"
msgstr ""
......
......@@ -365,7 +365,11 @@ RSpec.describe Notify do
it 'contains a link to merge request author' do
is_expected.to have_body_text merge_request.author_name
is_expected.to have_body_text 'created a merge request:'
is_expected.to have_body_text 'created a'
end
it 'contains a link to the merge request url' do
is_expected.to have_link('merge request', href: project_merge_request_url(merge_request.target_project, merge_request))
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment