Commit 57ad81a9c55352d39a88a5c878cc81f59f5328fa

Authored by Drew Blessing
1 parent 02484930

Fix minor errors/annoyances in email templates

There was some funny syntax in merge request email templates. There was a ! before
the merge request number when there probably should be a #. This may be some carry over
from markdown but should not be in email templates.  There were also some capitalization
discrepancies among the subject lines. For those OCD people out there I standardized the
capitalization. :)
app/mailers/emails/groups.rb
@@ -5,7 +5,7 @@ module Emails @@ -5,7 +5,7 @@ module Emails
5 @group = @membership.group 5 @group = @membership.group
6 6
7 mail(to: @membership.user.email, 7 mail(to: @membership.user.email,
8 - subject: subject("access to group was granted")) 8 + subject: subject("Access to group was granted"))
9 end 9 end
10 end 10 end
11 end 11 end
app/mailers/emails/issues.rb
@@ -3,14 +3,14 @@ module Emails @@ -3,14 +3,14 @@ module Emails
3 def new_issue_email(recipient_id, issue_id) 3 def new_issue_email(recipient_id, issue_id)
4 @issue = Issue.find(issue_id) 4 @issue = Issue.find(issue_id)
5 @project = @issue.project 5 @project = @issue.project
6 - mail(to: recipient(recipient_id), subject: subject("new issue ##{@issue.iid}", @issue.title)) 6 + mail(to: recipient(recipient_id), subject: subject("New issue ##{@issue.iid}", @issue.title))
7 end 7 end
8 8
9 def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) 9 def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id)
10 @issue = Issue.find(issue_id) 10 @issue = Issue.find(issue_id)
11 @previous_assignee = User.find_by_id(previous_assignee_id) if previous_assignee_id 11 @previous_assignee = User.find_by_id(previous_assignee_id) if previous_assignee_id
12 @project = @issue.project 12 @project = @issue.project
13 - mail(to: recipient(recipient_id), subject: subject("changed issue ##{@issue.iid}", @issue.title)) 13 + mail(to: recipient(recipient_id), subject: subject("Changed issue ##{@issue.iid}", @issue.title))
14 end 14 end
15 15
16 def closed_issue_email(recipient_id, issue_id, updated_by_user_id) 16 def closed_issue_email(recipient_id, issue_id, updated_by_user_id)
@@ -27,7 +27,7 @@ module Emails @@ -27,7 +27,7 @@ module Emails
27 @project = @issue.project 27 @project = @issue.project
28 @updated_by = User.find updated_by_user_id 28 @updated_by = User.find updated_by_user_id
29 mail(to: recipient(recipient_id), 29 mail(to: recipient(recipient_id),
30 - subject: subject("changed issue ##{@issue.iid}", @issue.title)) 30 + subject: subject("Changed issue ##{@issue.iid}", @issue.title))
31 end 31 end
32 end 32 end
33 end 33 end
app/mailers/emails/merge_requests.rb
@@ -2,24 +2,24 @@ module Emails @@ -2,24 +2,24 @@ module Emails
2 module MergeRequests 2 module MergeRequests
3 def new_merge_request_email(recipient_id, merge_request_id) 3 def new_merge_request_email(recipient_id, merge_request_id)
4 @merge_request = MergeRequest.find(merge_request_id) 4 @merge_request = MergeRequest.find(merge_request_id)
5 - mail(to: recipient(recipient_id), subject: subject("new merge request !#{@merge_request.iid}", @merge_request.title)) 5 + mail(to: recipient(recipient_id), subject: subject("New merge request ##{@merge_request.iid}", @merge_request.title))
6 end 6 end
7 7
8 def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) 8 def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id)
9 @merge_request = MergeRequest.find(merge_request_id) 9 @merge_request = MergeRequest.find(merge_request_id)
10 @previous_assignee = User.find_by_id(previous_assignee_id) if previous_assignee_id 10 @previous_assignee = User.find_by_id(previous_assignee_id) if previous_assignee_id
11 - mail(to: recipient(recipient_id), subject: subject("changed merge request !#{@merge_request.iid}", @merge_request.title)) 11 + mail(to: recipient(recipient_id), subject: subject("Changed merge request ##{@merge_request.iid}", @merge_request.title))
12 end 12 end
13 13
14 def closed_merge_request_email(recipient_id, merge_request_id, updated_by_user_id) 14 def closed_merge_request_email(recipient_id, merge_request_id, updated_by_user_id)
15 @merge_request = MergeRequest.find(merge_request_id) 15 @merge_request = MergeRequest.find(merge_request_id)
16 @updated_by = User.find updated_by_user_id 16 @updated_by = User.find updated_by_user_id
17 - mail(to: recipient(recipient_id), subject: subject("Closed merge request !#{@merge_request.iid}", @merge_request.title)) 17 + mail(to: recipient(recipient_id), subject: subject("Closed merge request ##{@merge_request.iid}", @merge_request.title))
18 end 18 end
19 19
20 def merged_merge_request_email(recipient_id, merge_request_id) 20 def merged_merge_request_email(recipient_id, merge_request_id)
21 @merge_request = MergeRequest.find(merge_request_id) 21 @merge_request = MergeRequest.find(merge_request_id)
22 - mail(to: recipient(recipient_id), subject: subject("Accepted merge request !#{@merge_request.iid}", @merge_request.title)) 22 + mail(to: recipient(recipient_id), subject: subject("Accepted merge request ##{@merge_request.iid}", @merge_request.title))
23 end 23 end
24 end 24 end
25 25
app/mailers/emails/notes.rb
@@ -4,27 +4,27 @@ module Emails @@ -4,27 +4,27 @@ module Emails
4 @note = Note.find(note_id) 4 @note = Note.find(note_id)
5 @commit = @note.noteable 5 @commit = @note.noteable
6 @project = @note.project 6 @project = @note.project
7 - mail(to: recipient(recipient_id), subject: subject("note for commit #{@commit.short_id}", @commit.title)) 7 + mail(to: recipient(recipient_id), subject: subject("Note for commit #{@commit.short_id}", @commit.title))
8 end 8 end
9 9
10 def note_issue_email(recipient_id, note_id) 10 def note_issue_email(recipient_id, note_id)
11 @note = Note.find(note_id) 11 @note = Note.find(note_id)
12 @issue = @note.noteable 12 @issue = @note.noteable
13 @project = @note.project 13 @project = @note.project
14 - mail(to: recipient(recipient_id), subject: subject("note for issue ##{@issue.iid}")) 14 + mail(to: recipient(recipient_id), subject: subject("Note for issue ##{@issue.iid}"))
15 end 15 end
16 16
17 def note_merge_request_email(recipient_id, note_id) 17 def note_merge_request_email(recipient_id, note_id)
18 @note = Note.find(note_id) 18 @note = Note.find(note_id)
19 @merge_request = @note.noteable 19 @merge_request = @note.noteable
20 @project = @note.project 20 @project = @note.project
21 - mail(to: recipient(recipient_id), subject: subject("note for merge request ##{@merge_request.iid}")) 21 + mail(to: recipient(recipient_id), subject: subject("Note for merge request ##{@merge_request.iid}"))
22 end 22 end
23 23
24 def note_wall_email(recipient_id, note_id) 24 def note_wall_email(recipient_id, note_id)
25 @note = Note.find(note_id) 25 @note = Note.find(note_id)
26 @project = @note.project 26 @project = @note.project
27 - mail(to: recipient(recipient_id), subject: subject("note on wall")) 27 + mail(to: recipient(recipient_id), subject: subject("Note on wall"))
28 end 28 end
29 end 29 end
30 end 30 end
app/mailers/emails/projects.rb
@@ -4,14 +4,14 @@ module Emails @@ -4,14 +4,14 @@ module Emails
4 @users_project = UsersProject.find user_project_id 4 @users_project = UsersProject.find user_project_id
5 @project = @users_project.project 5 @project = @users_project.project
6 mail(to: @users_project.user.email, 6 mail(to: @users_project.user.email,
7 - subject: subject("access to project was granted")) 7 + subject: subject("Access to project was granted"))
8 end 8 end
9 9
10 def project_was_moved_email(project_id, user_id) 10 def project_was_moved_email(project_id, user_id)
11 @user = User.find user_id 11 @user = User.find user_id
12 @project = Project.find project_id 12 @project = Project.find project_id
13 mail(to: @user.email, 13 mail(to: @user.email,
14 - subject: subject("project was moved")) 14 + subject: subject("Project was moved"))
15 end 15 end
16 end 16 end
17 end 17 end
app/views/notify/new_merge_request_email.html.haml
1 %p 1 %p
2 - = "New Merge Request !#{@merge_request.iid}" 2 + = "New Merge Request ##{@merge_request.iid}"
3 %p 3 %p
4 = link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.target_project, @merge_request) 4 = link_to_gfm truncate(@merge_request.title, length: 40), project_merge_request_url(@merge_request.target_project, @merge_request)
5 %p 5 %p
app/views/notify/new_merge_request_email.text.erb
1 -New Merge Request <%= @merge_request.iid %> 1 +New Merge Request #<%= @merge_request.iid %>
2 2
3 <%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request)) %> 3 <%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request)) %>
4 4
app/views/notify/reassigned_merge_request_email.html.haml
1 %p 1 %p
2 - = "Reassigned Merge Request !#{@merge_request.iid}" 2 + = "Reassigned Merge Request ##{@merge_request.iid}"
3 = link_to_gfm truncate(@merge_request.title, length: 30), project_merge_request_url(@merge_request.target_project, @merge_request) 3 = link_to_gfm truncate(@merge_request.title, length: 30), project_merge_request_url(@merge_request.target_project, @merge_request)
4 %p 4 %p
5 Assignee changed 5 Assignee changed
app/views/notify/reassigned_merge_request_email.text.erb
1 -Reassigned Merge Request <%= @merge_request.iid %> 1 +Reassigned Merge Request #<%= @merge_request.iid %>
2 2
3 <%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request)) %> 3 <%= url_for(project_merge_request_url(@merge_request.target_project, @merge_request)) %>
4 4
spec/mailers/notify_spec.rb
@@ -110,7 +110,7 @@ describe Notify do @@ -110,7 +110,7 @@ describe Notify do
110 it_behaves_like 'an assignee email' 110 it_behaves_like 'an assignee email'
111 111
112 it 'has the correct subject' do 112 it 'has the correct subject' do
113 - should have_subject /#{project.name} \| new issue ##{issue.iid} \| #{issue.title}/ 113 + should have_subject /#{project.name} \| New issue ##{issue.iid} \| #{issue.title}/
114 end 114 end
115 115
116 it 'contains a link to the new issue' do 116 it 'contains a link to the new issue' do
@@ -126,7 +126,7 @@ describe Notify do @@ -126,7 +126,7 @@ describe Notify do
126 it_behaves_like 'a multiple recipients email' 126 it_behaves_like 'a multiple recipients email'
127 127
128 it 'has the correct subject' do 128 it 'has the correct subject' do
129 - should have_subject /changed issue ##{issue.iid} \| #{issue.title}/ 129 + should have_subject /Changed issue ##{issue.iid} \| #{issue.title}/
130 end 130 end
131 131
132 it 'contains the name of the previous assignee' do 132 it 'contains the name of the previous assignee' do
@@ -148,7 +148,7 @@ describe Notify do @@ -148,7 +148,7 @@ describe Notify do
148 subject { Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user) } 148 subject { Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user) }
149 149
150 it 'has the correct subject' do 150 it 'has the correct subject' do
151 - should have_subject /changed issue ##{issue.iid} \| #{issue.title}/i 151 + should have_subject /Changed issue ##{issue.iid} \| #{issue.title}/i
152 end 152 end
153 153
154 it 'contains the new status' do 154 it 'contains the new status' do
@@ -175,7 +175,7 @@ describe Notify do @@ -175,7 +175,7 @@ describe Notify do
175 it_behaves_like 'an assignee email' 175 it_behaves_like 'an assignee email'
176 176
177 it 'has the correct subject' do 177 it 'has the correct subject' do
178 - should have_subject /new merge request !#{merge_request.iid}/ 178 + should have_subject /New merge request ##{merge_request.iid}/
179 end 179 end
180 180
181 it 'contains a link to the new merge request' do 181 it 'contains a link to the new merge request' do
@@ -199,7 +199,7 @@ describe Notify do @@ -199,7 +199,7 @@ describe Notify do
199 it_behaves_like 'a multiple recipients email' 199 it_behaves_like 'a multiple recipients email'
200 200
201 it 'has the correct subject' do 201 it 'has the correct subject' do
202 - should have_subject /changed merge request !#{merge_request.iid}/ 202 + should have_subject /Changed merge request ##{merge_request.iid}/
203 end 203 end
204 204
205 it 'contains the name of the previous assignee' do 205 it 'contains the name of the previous assignee' do
@@ -224,7 +224,7 @@ describe Notify do @@ -224,7 +224,7 @@ describe Notify do
224 subject { Notify.project_was_moved_email(project.id, user.id) } 224 subject { Notify.project_was_moved_email(project.id, user.id) }
225 225
226 it 'has the correct subject' do 226 it 'has the correct subject' do
227 - should have_subject /project was moved/ 227 + should have_subject /Project was moved/
228 end 228 end
229 229
230 it 'contains name of project' do 230 it 'contains name of project' do
@@ -244,7 +244,7 @@ describe Notify do @@ -244,7 +244,7 @@ describe Notify do
244 user: user) } 244 user: user) }
245 subject { Notify.project_access_granted_email(users_project.id) } 245 subject { Notify.project_access_granted_email(users_project.id) }
246 it 'has the correct subject' do 246 it 'has the correct subject' do
247 - should have_subject /access to project was granted/ 247 + should have_subject /Access to project was granted/
248 end 248 end
249 it 'contains name of project' do 249 it 'contains name of project' do
250 should have_body_text /#{project.name}/ 250 should have_body_text /#{project.name}/
@@ -302,7 +302,7 @@ describe Notify do @@ -302,7 +302,7 @@ describe Notify do
302 it_behaves_like 'a note email' 302 it_behaves_like 'a note email'
303 303
304 it 'has the correct subject' do 304 it 'has the correct subject' do
305 - should have_subject /note for commit #{commit.short_id}/ 305 + should have_subject /Note for commit #{commit.short_id}/
306 end 306 end
307 307
308 it 'contains a link to the commit' do 308 it 'contains a link to the commit' do
@@ -320,7 +320,7 @@ describe Notify do @@ -320,7 +320,7 @@ describe Notify do
320 it_behaves_like 'a note email' 320 it_behaves_like 'a note email'
321 321
322 it 'has the correct subject' do 322 it 'has the correct subject' do
323 - should have_subject /note for merge request ##{merge_request.iid}/ 323 + should have_subject /Note for merge request ##{merge_request.iid}/
324 end 324 end
325 325
326 it 'contains a link to the merge request note' do 326 it 'contains a link to the merge request note' do
@@ -338,7 +338,7 @@ describe Notify do @@ -338,7 +338,7 @@ describe Notify do
338 it_behaves_like 'a note email' 338 it_behaves_like 'a note email'
339 339
340 it 'has the correct subject' do 340 it 'has the correct subject' do
341 - should have_subject /note for issue ##{issue.iid}/ 341 + should have_subject /Note for issue ##{issue.iid}/
342 end 342 end
343 343
344 it 'contains a link to the issue note' do 344 it 'contains a link to the issue note' do
@@ -356,7 +356,7 @@ describe Notify do @@ -356,7 +356,7 @@ describe Notify do
356 subject { Notify.group_access_granted_email(membership.id) } 356 subject { Notify.group_access_granted_email(membership.id) }
357 357
358 it 'has the correct subject' do 358 it 'has the correct subject' do
359 - should have_subject /access to group was granted/ 359 + should have_subject /Access to group was granted/
360 end 360 end
361 361
362 it 'contains name of project' do 362 it 'contains name of project' do