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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
74c8e091
Commit
74c8e091
authored
Sep 02, 2016
by
Fu Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add configurable email subject suffix
parent
71345998
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
22 additions
and
9 deletions
+22
-9
CHANGELOG
CHANGELOG
+4
-0
app/mailers/notify.rb
app/mailers/notify.rb
+1
-0
config/gitlab.yml.example
config/gitlab.yml.example
+1
-0
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-0
doc/administration/environment_variables.md
doc/administration/environment_variables.md
+11
-9
spec/mailers/shared/notify.rb
spec/mailers/shared/notify.rb
+4
-0
No files found.
CHANGELOG
View file @
74c8e091
...
...
@@ -271,6 +271,10 @@ v 8.11.6
v 8.11.5
- Optimize branch lookups and force a repository reload for Repository#find_branch. !6087
- Fix member expiration date picker after update. !6184
- Add configurable email subject suffix
v 8.11.5 (unreleased)
- Optimize branch lookups and force a repository reload for Repository#find_branch
- Fix suggested colors options for new labels in the admin area. !6138
- Optimize discussion notes resolving and unresolving
- Fix GitLab import button
...
...
app/mailers/notify.rb
View file @
74c8e091
...
...
@@ -92,6 +92,7 @@ class Notify < BaseMailer
subject
=
""
subject
<<
"
#{
@project
.
name
}
| "
if
@project
subject
<<
extra
.
join
(
' | '
)
if
extra
.
present?
subject
<<
" |
#{
Gitlab
.
config
.
gitlab
.
email_subject_suffix
}
"
if
Gitlab
.
config
.
gitlab
.
email_subject_suffix
.
length
>
0
subject
end
...
...
config/gitlab.yml.example
View file @
74c8e091
...
...
@@ -70,6 +70,7 @@ production: &base
email_from: example@example.com
email_display_name: GitLab
email_reply_to: noreply@example.com
email_subject_suffix: ''
# Email server smtp settings are in config/initializers/smtp_settings.rb.sample
...
...
config/initializers/1_settings.rb
View file @
74c8e091
...
...
@@ -186,6 +186,7 @@ Settings.gitlab['email_enabled'] ||= true if Settings.gitlab['email_enabled'].ni
Settings
.
gitlab
[
'email_from'
]
||=
ENV
[
'GITLAB_EMAIL_FROM'
]
||
"gitlab@
#{
Settings
.
gitlab
.
host
}
"
Settings
.
gitlab
[
'email_display_name'
]
||=
ENV
[
'GITLAB_EMAIL_DISPLAY_NAME'
]
||
'GitLab'
Settings
.
gitlab
[
'email_reply_to'
]
||=
ENV
[
'GITLAB_EMAIL_REPLY_TO'
]
||
"noreply@
#{
Settings
.
gitlab
.
host
}
"
Settings
.
gitlab
[
'email_subject_suffix'
]
||=
ENV
[
'GITLAB_EMAIL_SUBJECT_SUFFIX'
]
||
""
Settings
.
gitlab
[
'base_url'
]
||=
Settings
.
send
(
:build_base_gitlab_url
)
Settings
.
gitlab
[
'url'
]
||=
Settings
.
send
(
:build_gitlab_url
)
Settings
.
gitlab
[
'user'
]
||=
'git'
...
...
doc/administration/environment_variables.md
View file @
74c8e091
...
...
@@ -13,15 +13,17 @@ override certain values.
Variable | Type | Description
-------- | ---- | -----------
`GITLAB_ROOT_PASSWORD`
| string | Sets the password for the
`root`
user on installation
`GITLAB_HOST`
| string | The full URL of the GitLab server (including
`http://`
or
`https://`
)
`RAILS_ENV`
| string | The Rails environment; can be one of
`production`
,
`development`
,
`staging`
or
`test`
`DATABASE_URL`
| string | The database URL; is of the form:
`postgresql://localhost/blog_development`
`GITLAB_EMAIL_FROM`
| string | The e-mail address used in the "From" field in e-mails sent by GitLab
`GITLAB_EMAIL_DISPLAY_NAME`
| string | The name used in the "From" field in e-mails sent by GitLab
`GITLAB_EMAIL_REPLY_TO`
| string | The e-mail address used in the "Reply-To" field in e-mails sent by GitLab
`GITLAB_UNICORN_MEMORY_MIN`
| integer | The minimum memory threshold (in bytes) for the Unicorn worker killer
`GITLAB_UNICORN_MEMORY_MAX`
| integer | The maximum memory threshold (in bytes) for the Unicorn worker killer
`GITLAB_ROOT_PASSWORD`
| string | Sets the password for the
`root`
user on installation
`GITLAB_HOST`
| string | The full URL of the GitLab server (including
`http://`
or
`https://`
)
`RAILS_ENV`
| string | The Rails environment; can be one of
`production`
,
`development`
,
`staging`
or
`test`
`DATABASE_URL`
| string | The database URL; is of the form:
`postgresql://localhost/blog_development`
`GITLAB_EMAIL_FROM`
| string | The e-mail address used in the "From" field in e-mails sent by GitLab
`GITLAB_EMAIL_DISPLAY_NAME`
| string | The name used in the "From" field in e-mails sent by GitLab
`GITLAB_EMAIL_REPLY_TO`
| string | The e-mail address used in the "Reply-To" field in e-mails sent by GitLab
`GITLAB_EMAIL_REPLY_TO`
| string | The e-mail address used in the "Reply-To" field in e-mails sent by GitLab
`GITLAB_EMAIL_SUBJECT_SUFFIX`
| string | The e-mail subject suffix used in e-mails sent by GitLab
`GITLAB_UNICORN_MEMORY_MIN`
| integer | The minimum memory threshold (in bytes) for the Unicorn worker killer
`GITLAB_UNICORN_MEMORY_MAX`
| integer | The maximum memory threshold (in bytes) for the Unicorn worker killer
## Complete database variables
...
...
spec/mailers/shared/notify.rb
View file @
74c8e091
...
...
@@ -2,6 +2,7 @@ shared_context 'gitlab email notification' do
let
(
:gitlab_sender_display_name
)
{
Gitlab
.
config
.
gitlab
.
email_display_name
}
let
(
:gitlab_sender
)
{
Gitlab
.
config
.
gitlab
.
email_from
}
let
(
:gitlab_sender_reply_to
)
{
Gitlab
.
config
.
gitlab
.
email_reply_to
}
let
(
:gitlab_subject_suffix
)
{
Gitlab
.
config
.
gitlab
.
email_subject_suffix
}
let
(
:recipient
)
{
create
(
:user
,
email:
'recipient@example.com'
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:new_user_address
)
{
'newguy@example.com'
}
...
...
@@ -31,6 +32,9 @@ shared_examples 'an email sent from GitLab' do
sender
=
subject
.
header
[
:from
].
addrs
[
0
]
expect
(
sender
.
display_name
).
to
eq
(
gitlab_sender_display_name
)
expect
(
sender
.
address
).
to
eq
(
gitlab_sender
)
if
gitlab_subject_suffix
.
length
>
0
is_expected
.
to
have_subject
gitlab_subject_suffix
end
end
it
'has a Reply-To address'
do
...
...
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