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
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
36b255e5
Commit
36b255e5
authored
Feb 07, 2015
by
Aleks Bunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addex X-GitLab-Project header to GitLab emails.
Fixes #8748.
parent
5bf33f97
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
app/mailers/notify.rb
app/mailers/notify.rb
+2
-0
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+2
-0
No files found.
app/mailers/notify.rb
View file @
36b255e5
...
@@ -111,6 +111,7 @@ class Notify < ActionMailer::Base
...
@@ -111,6 +111,7 @@ class Notify < ActionMailer::Base
# See: mail_answer_thread
# See: mail_answer_thread
def
mail_new_thread
(
model
,
headers
=
{},
&
block
)
def
mail_new_thread
(
model
,
headers
=
{},
&
block
)
headers
[
'Message-ID'
]
=
message_id
(
model
)
headers
[
'Message-ID'
]
=
message_id
(
model
)
headers
[
'X-GitLab-Project'
]
=
"
#{
@project
.
name
}
| "
if
@project
mail
(
headers
,
&
block
)
mail
(
headers
,
&
block
)
end
end
...
@@ -125,6 +126,7 @@ class Notify < ActionMailer::Base
...
@@ -125,6 +126,7 @@ class Notify < ActionMailer::Base
def
mail_answer_thread
(
model
,
headers
=
{},
&
block
)
def
mail_answer_thread
(
model
,
headers
=
{},
&
block
)
headers
[
'In-Reply-To'
]
=
message_id
(
model
)
headers
[
'In-Reply-To'
]
=
message_id
(
model
)
headers
[
'References'
]
=
message_id
(
model
)
headers
[
'References'
]
=
message_id
(
model
)
headers
[
'X-GitLab-Project'
]
=
"
#{
@project
.
name
}
| "
if
@project
if
(
headers
[
:subject
])
if
(
headers
[
:subject
])
headers
[
:subject
].
prepend
(
'Re: '
)
headers
[
:subject
].
prepend
(
'Re: '
)
...
...
spec/mailers/notify_spec.rb
View file @
36b255e5
...
@@ -26,6 +26,7 @@ describe Notify do
...
@@ -26,6 +26,7 @@ describe Notify do
shared_examples
'an email starting a new thread'
do
|
message_id_prefix
|
shared_examples
'an email starting a new thread'
do
|
message_id_prefix
|
it
'has a discussion identifier'
do
it
'has a discussion identifier'
do
should
have_header
'Message-ID'
,
/<
#{
message_id_prefix
}
(.*)@
#{
Gitlab
.
config
.
gitlab
.
host
}
>/
should
have_header
'Message-ID'
,
/<
#{
message_id_prefix
}
(.*)@
#{
Gitlab
.
config
.
gitlab
.
host
}
>/
should
have_header
'X-GitLab-Project'
,
/
#{
project
.
name
}
/
end
end
end
end
...
@@ -37,6 +38,7 @@ describe Notify do
...
@@ -37,6 +38,7 @@ describe Notify do
it
'has headers that reference an existing thread'
do
it
'has headers that reference an existing thread'
do
should
have_header
'References'
,
/<
#{
thread_id_prefix
}
(.*)@
#{
Gitlab
.
config
.
gitlab
.
host
}
>/
should
have_header
'References'
,
/<
#{
thread_id_prefix
}
(.*)@
#{
Gitlab
.
config
.
gitlab
.
host
}
>/
should
have_header
'In-Reply-To'
,
/<
#{
thread_id_prefix
}
(.*)@
#{
Gitlab
.
config
.
gitlab
.
host
}
>/
should
have_header
'In-Reply-To'
,
/<
#{
thread_id_prefix
}
(.*)@
#{
Gitlab
.
config
.
gitlab
.
host
}
>/
should
have_header
'X-GitLab-Project'
,
/
#{
project
.
name
}
/
end
end
end
end
...
...
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