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 57 # >> subject('Lorem ipsum', 'Dolor sit amet')
58 58 # => "GitLab Merge Request | Lorem ipsum | Dolor sit amet"
59 59 def subject(*extra)
60   - subject = "GitLab Merge Request |"
  60 + subject = "Merge Request | "
61 61 if @merge_request.for_fork?
62 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 63 else
... ...
app/mailers/notify.rb
... ... @@ -43,21 +43,21 @@ class Notify &lt; ActionMailer::Base
43 43 # Examples
44 44 #
45 45 # >> subject('Lorem ipsum')
46   - # => "GitLab | Lorem ipsum"
  46 + # => "Lorem ipsum"
47 47 #
48 48 # # Automatically inserts Project name when @project is set
49 49 # >> @project = Project.last
50 50 # => #<Project id: 1, name: "Ruby on Rails", path: "ruby_on_rails", ...>
51 51 # >> subject('Lorem ipsum')
52   - # => "GitLab | Ruby on Rails | Lorem ipsum "
  52 + # => "Ruby on Rails | Lorem ipsum "
53 53 #
54 54 # # Accepts multiple arguments
55 55 # >> subject('Lorem ipsum', 'Dolor sit amet')
56   - # => "GitLab | Lorem ipsum | Dolor sit amet"
  56 + # => "Lorem ipsum | Dolor sit amet"
57 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 61 subject
62 62 end
63 63 end
... ...
spec/mailers/notify_spec.rb
... ... @@ -24,7 +24,7 @@ describe Notify do
24 24 end
25 25  
26 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 28 end
29 29  
30 30 it 'contains the new user\'s login name' do
... ... @@ -52,7 +52,7 @@ describe Notify do
52 52 end
53 53  
54 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 56 end
57 57  
58 58 it 'contains the new user\'s login name' do
... ... @@ -78,7 +78,7 @@ describe Notify do
78 78 end
79 79  
80 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 82 end
83 83  
84 84 it 'contains the new ssh key title' do
... ...