Remove the email subject prefix

This changes email subjects from:

    GitLab | Team / Project | Note for issue #1234

to:

    Team / Project | Note for issue #1234

Rationale:

* Emails should be as meaningful as possible, and emphasize content over
chrome. The "GitLab" name is more chrome than content.

* Users can tell an email coming from GitLab by the sender or the header
in the email content.

* An organization that works mainly with GitLab knows that
every SVC email comes from GitLab. For these organizations, having
"GitLab" in front of every email is just noise hiding the meaningful
information.
parent 49cb1c72
No related merge requests found
......@@ -57,7 +57,7 @@ module Emails
# >> subject('Lorem ipsum', 'Dolor sit amet')
# => "GitLab Merge Request | Lorem ipsum | Dolor sit amet"
def subject(*extra)
subject = "GitLab Merge Request |"
subject = "Merge Request | "
if @merge_request.for_fork?
subject << "#{@merge_request.source_project.name_with_namespace}:#{merge_request.source_branch} >> #{@merge_request.target_project.name_with_namespace}:#{merge_request.target_branch}"
else
......
......@@ -43,21 +43,21 @@ class Notify < ActionMailer::Base
# Examples
#
# >> subject('Lorem ipsum')
# => "GitLab | Lorem ipsum"
# => "Lorem ipsum"
#
# # Automatically inserts Project name when @project is set
# >> @project = Project.last
# => #<Project id: 1, name: "Ruby on Rails", path: "ruby_on_rails", ...>
# >> subject('Lorem ipsum')
# => "GitLab | Ruby on Rails | Lorem ipsum "
# => "Ruby on Rails | Lorem ipsum "
#
# # Accepts multiple arguments
# >> subject('Lorem ipsum', 'Dolor sit amet')
# => "GitLab | Lorem ipsum | Dolor sit amet"
# => "Lorem ipsum | Dolor sit amet"
def subject(*extra)
subject = "GitLab"
subject << (@project ? " | #{@project.name_with_namespace}" : "")
subject << " | " + extra.join(' | ') if extra.present?
subject = ""
subject << "#{@project.name_with_namespace} | " if @project
subject << extra.join(' | ') if extra.present?
subject
end
end
......@@ -24,7 +24,7 @@ describe Notify do
end
it 'has the correct subject' do
should have_subject /^gitlab \| Account was created for you$/i
should have_subject /^Account was created for you$/i
end
it 'contains the new user\'s login name' do
......@@ -52,7 +52,7 @@ describe Notify do
end
it 'has the correct subject' do
should have_subject /^gitlab \| Account was created for you$/i
should have_subject /^Account was created for you$/i
end
it 'contains the new user\'s login name' do
......@@ -78,7 +78,7 @@ describe Notify do
end
it 'has the correct subject' do
should have_subject /^gitlab \| SSH key was added to your account$/i
should have_subject /^SSH key was added to your account$/i
end
it 'contains the new ssh key title' do
......
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