Commit ea3680ad80e7623e03341a2568e775527bd47fd3
Exists in
master
and in
4 other branches
Merge pull request #5571 from bke-drewb/email
Fix minor errors/annoyances in email templates
Showing
10 changed files
with
29 additions
and
29 deletions
Show diff stats
app/mailers/emails/groups.rb
app/mailers/emails/issues.rb
... | ... | @@ -3,14 +3,14 @@ module Emails |
3 | 3 | def new_issue_email(recipient_id, issue_id) |
4 | 4 | @issue = Issue.find(issue_id) |
5 | 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 | 7 | end |
8 | 8 | |
9 | 9 | def reassigned_issue_email(recipient_id, issue_id, previous_assignee_id) |
10 | 10 | @issue = Issue.find(issue_id) |
11 | 11 | @previous_assignee = User.find_by_id(previous_assignee_id) if previous_assignee_id |
12 | 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 | 14 | end |
15 | 15 | |
16 | 16 | def closed_issue_email(recipient_id, issue_id, updated_by_user_id) |
... | ... | @@ -27,7 +27,7 @@ module Emails |
27 | 27 | @project = @issue.project |
28 | 28 | @updated_by = User.find updated_by_user_id |
29 | 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 | 31 | end |
32 | 32 | end |
33 | 33 | end | ... | ... |
app/mailers/emails/merge_requests.rb
... | ... | @@ -2,24 +2,24 @@ module Emails |
2 | 2 | module MergeRequests |
3 | 3 | def new_merge_request_email(recipient_id, merge_request_id) |
4 | 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 | 6 | end |
7 | 7 | |
8 | 8 | def reassigned_merge_request_email(recipient_id, merge_request_id, previous_assignee_id) |
9 | 9 | @merge_request = MergeRequest.find(merge_request_id) |
10 | 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 | 12 | end |
13 | 13 | |
14 | 14 | def closed_merge_request_email(recipient_id, merge_request_id, updated_by_user_id) |
15 | 15 | @merge_request = MergeRequest.find(merge_request_id) |
16 | 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 | 18 | end |
19 | 19 | |
20 | 20 | def merged_merge_request_email(recipient_id, merge_request_id) |
21 | 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 | 23 | end |
24 | 24 | end |
25 | 25 | ... | ... |
app/mailers/emails/notes.rb
... | ... | @@ -4,27 +4,27 @@ module Emails |
4 | 4 | @note = Note.find(note_id) |
5 | 5 | @commit = @note.noteable |
6 | 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 | 8 | end |
9 | 9 | |
10 | 10 | def note_issue_email(recipient_id, note_id) |
11 | 11 | @note = Note.find(note_id) |
12 | 12 | @issue = @note.noteable |
13 | 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 | 15 | end |
16 | 16 | |
17 | 17 | def note_merge_request_email(recipient_id, note_id) |
18 | 18 | @note = Note.find(note_id) |
19 | 19 | @merge_request = @note.noteable |
20 | 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 | 22 | end |
23 | 23 | |
24 | 24 | def note_wall_email(recipient_id, note_id) |
25 | 25 | @note = Note.find(note_id) |
26 | 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 | 28 | end |
29 | 29 | end |
30 | 30 | end | ... | ... |
app/mailers/emails/projects.rb
... | ... | @@ -4,14 +4,14 @@ module Emails |
4 | 4 | @users_project = UsersProject.find user_project_id |
5 | 5 | @project = @users_project.project |
6 | 6 | mail(to: @users_project.user.email, |
7 | - subject: subject("access to project was granted")) | |
7 | + subject: subject("Access to project was granted")) | |
8 | 8 | end |
9 | 9 | |
10 | 10 | def project_was_moved_email(project_id, user_id) |
11 | 11 | @user = User.find user_id |
12 | 12 | @project = Project.find project_id |
13 | 13 | mail(to: @user.email, |
14 | - subject: subject("project was moved")) | |
14 | + subject: subject("Project was moved")) | |
15 | 15 | end |
16 | 16 | end |
17 | 17 | end | ... | ... |
app/views/notify/new_merge_request_email.html.haml
app/views/notify/new_merge_request_email.text.erb
app/views/notify/reassigned_merge_request_email.html.haml
app/views/notify/reassigned_merge_request_email.text.erb
spec/mailers/notify_spec.rb
... | ... | @@ -110,7 +110,7 @@ describe Notify do |
110 | 110 | it_behaves_like 'an assignee email' |
111 | 111 | |
112 | 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 | 114 | end |
115 | 115 | |
116 | 116 | it 'contains a link to the new issue' do |
... | ... | @@ -126,7 +126,7 @@ describe Notify do |
126 | 126 | it_behaves_like 'a multiple recipients email' |
127 | 127 | |
128 | 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 | 130 | end |
131 | 131 | |
132 | 132 | it 'contains the name of the previous assignee' do |
... | ... | @@ -148,7 +148,7 @@ describe Notify do |
148 | 148 | subject { Notify.issue_status_changed_email(recipient.id, issue.id, status, current_user) } |
149 | 149 | |
150 | 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 | 152 | end |
153 | 153 | |
154 | 154 | it 'contains the new status' do |
... | ... | @@ -175,7 +175,7 @@ describe Notify do |
175 | 175 | it_behaves_like 'an assignee email' |
176 | 176 | |
177 | 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 | 179 | end |
180 | 180 | |
181 | 181 | it 'contains a link to the new merge request' do |
... | ... | @@ -199,7 +199,7 @@ describe Notify do |
199 | 199 | it_behaves_like 'a multiple recipients email' |
200 | 200 | |
201 | 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 | 203 | end |
204 | 204 | |
205 | 205 | it 'contains the name of the previous assignee' do |
... | ... | @@ -224,7 +224,7 @@ describe Notify do |
224 | 224 | subject { Notify.project_was_moved_email(project.id, user.id) } |
225 | 225 | |
226 | 226 | it 'has the correct subject' do |
227 | - should have_subject /project was moved/ | |
227 | + should have_subject /Project was moved/ | |
228 | 228 | end |
229 | 229 | |
230 | 230 | it 'contains name of project' do |
... | ... | @@ -244,7 +244,7 @@ describe Notify do |
244 | 244 | user: user) } |
245 | 245 | subject { Notify.project_access_granted_email(users_project.id) } |
246 | 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 | 248 | end |
249 | 249 | it 'contains name of project' do |
250 | 250 | should have_body_text /#{project.name}/ |
... | ... | @@ -302,7 +302,7 @@ describe Notify do |
302 | 302 | it_behaves_like 'a note email' |
303 | 303 | |
304 | 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 | 306 | end |
307 | 307 | |
308 | 308 | it 'contains a link to the commit' do |
... | ... | @@ -320,7 +320,7 @@ describe Notify do |
320 | 320 | it_behaves_like 'a note email' |
321 | 321 | |
322 | 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 | 324 | end |
325 | 325 | |
326 | 326 | it 'contains a link to the merge request note' do |
... | ... | @@ -338,7 +338,7 @@ describe Notify do |
338 | 338 | it_behaves_like 'a note email' |
339 | 339 | |
340 | 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 | 342 | end |
343 | 343 | |
344 | 344 | it 'contains a link to the issue note' do |
... | ... | @@ -356,7 +356,7 @@ describe Notify do |
356 | 356 | subject { Notify.group_access_granted_email(membership.id) } |
357 | 357 | |
358 | 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 | 360 | end |
361 | 361 | |
362 | 362 | it 'contains name of project' do | ... | ... |