Commit 44ab156ef45fb1a566395b4d98afe796b28d21c9

Authored by Pierre de La Morinerie
1 parent 49cb1c72

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.
app/mailers/emails/merge_requests.rb
@@ -57,7 +57,7 @@ module Emails @@ -57,7 +57,7 @@ module Emails
57 # >> subject('Lorem ipsum', 'Dolor sit amet') 57 # >> subject('Lorem ipsum', 'Dolor sit amet')
58 # => "GitLab Merge Request | Lorem ipsum | Dolor sit amet" 58 # => "GitLab Merge Request | Lorem ipsum | Dolor sit amet"
59 def subject(*extra) 59 def subject(*extra)
60 - subject = "GitLab Merge Request |" 60 + subject = "Merge Request | "
61 if @merge_request.for_fork? 61 if @merge_request.for_fork?
62 subject << "#{@merge_request.source_project.name_with_namespace}:#{merge_request.source_branch} >> #{@merge_request.target_project.name_with_namespace}:#{merge_request.target_branch}" 62 subject << "#{@merge_request.source_project.name_with_namespace}:#{merge_request.source_branch} >> #{@merge_request.target_project.name_with_namespace}:#{merge_request.target_branch}"
63 else 63 else
app/mailers/notify.rb
@@ -43,21 +43,21 @@ class Notify &lt; ActionMailer::Base @@ -43,21 +43,21 @@ class Notify &lt; ActionMailer::Base
43 # Examples 43 # Examples
44 # 44 #
45 # >> subject('Lorem ipsum') 45 # >> subject('Lorem ipsum')
46 - # => "GitLab | Lorem ipsum" 46 + # => "Lorem ipsum"
47 # 47 #
48 # # Automatically inserts Project name when @project is set 48 # # Automatically inserts Project name when @project is set
49 # >> @project = Project.last 49 # >> @project = Project.last
50 # => #<Project id: 1, name: "Ruby on Rails", path: "ruby_on_rails", ...> 50 # => #<Project id: 1, name: "Ruby on Rails", path: "ruby_on_rails", ...>
51 # >> subject('Lorem ipsum') 51 # >> subject('Lorem ipsum')
52 - # => "GitLab | Ruby on Rails | Lorem ipsum " 52 + # => "Ruby on Rails | Lorem ipsum "
53 # 53 #
54 # # Accepts multiple arguments 54 # # Accepts multiple arguments
55 # >> subject('Lorem ipsum', 'Dolor sit amet') 55 # >> subject('Lorem ipsum', 'Dolor sit amet')
56 - # => "GitLab | Lorem ipsum | Dolor sit amet" 56 + # => "Lorem ipsum | Dolor sit amet"
57 def subject(*extra) 57 def subject(*extra)
58 - subject = "GitLab"  
59 - subject << (@project ? " | #{@project.name_with_namespace}" : "")  
60 - subject << " | " + extra.join(' | ') if extra.present? 58 + subject = ""
  59 + subject << "#{@project.name_with_namespace} | " if @project
  60 + subject << extra.join(' | ') if extra.present?
61 subject 61 subject
62 end 62 end
63 end 63 end
spec/mailers/notify_spec.rb
@@ -24,7 +24,7 @@ describe Notify do @@ -24,7 +24,7 @@ describe Notify do
24 end 24 end
25 25
26 it 'has the correct subject' do 26 it 'has the correct subject' do
27 - should have_subject /^gitlab \| Account was created for you$/i 27 + should have_subject /^Account was created for you$/i
28 end 28 end
29 29
30 it 'contains the new user\'s login name' do 30 it 'contains the new user\'s login name' do
@@ -52,7 +52,7 @@ describe Notify do @@ -52,7 +52,7 @@ describe Notify do
52 end 52 end
53 53
54 it 'has the correct subject' do 54 it 'has the correct subject' do
55 - should have_subject /^gitlab \| Account was created for you$/i 55 + should have_subject /^Account was created for you$/i
56 end 56 end
57 57
58 it 'contains the new user\'s login name' do 58 it 'contains the new user\'s login name' do
@@ -78,7 +78,7 @@ describe Notify do @@ -78,7 +78,7 @@ describe Notify do
78 end 78 end
79 79
80 it 'has the correct subject' do 80 it 'has the correct subject' do
81 - should have_subject /^gitlab \| SSH key was added to your account$/i 81 + should have_subject /^SSH key was added to your account$/i
82 end 82 end
83 83
84 it 'contains the new ssh key title' do 84 it 'contains the new ssh key title' do