Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
ea3680ad
Commit
ea3680ad
authored
Nov 08, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5571 from bke-drewb/email
Fix minor errors/annoyances in email templates
parents
b287462b
57ad81a9
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
29 additions
and
29 deletions
+29
-29
app/mailers/emails/groups.rb
app/mailers/emails/groups.rb
+1
-1
app/mailers/emails/issues.rb
app/mailers/emails/issues.rb
+3
-3
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+4
-4
app/mailers/emails/notes.rb
app/mailers/emails/notes.rb
+4
-4
app/mailers/emails/projects.rb
app/mailers/emails/projects.rb
+2
-2
app/views/notify/new_merge_request_email.html.haml
app/views/notify/new_merge_request_email.html.haml
+1
-1
app/views/notify/new_merge_request_email.text.erb
app/views/notify/new_merge_request_email.text.erb
+1
-1
app/views/notify/reassigned_merge_request_email.html.haml
app/views/notify/reassigned_merge_request_email.html.haml
+1
-1
app/views/notify/reassigned_merge_request_email.text.erb
app/views/notify/reassigned_merge_request_email.text.erb
+1
-1
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+11
-11
No files found.
app/mailers/emails/groups.rb
View file @
ea3680ad
...
@@ -5,7 +5,7 @@ module Emails
...
@@ -5,7 +5,7 @@ module Emails
@group
=
@membership
.
group
@group
=
@membership
.
group
mail
(
to:
@membership
.
user
.
email
,
mail
(
to:
@membership
.
user
.
email
,
subject:
subject
(
"
a
ccess to group was granted"
))
subject:
subject
(
"
A
ccess to group was granted"
))
end
end
end
end
end
end
app/mailers/emails/issues.rb
View file @
ea3680ad
...
@@ -3,14 +3,14 @@ module Emails
...
@@ -3,14 +3,14 @@ module Emails
def
new_issue_email
(
recipient_id
,
issue_id
)
def
new_issue_email
(
recipient_id
,
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@project
=
@issue
.
project
@project
=
@issue
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ew issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ew issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
end
end
def
reassigned_issue_email
(
recipient_id
,
issue_id
,
previous_assignee_id
)
def
reassigned_issue_email
(
recipient_id
,
issue_id
,
previous_assignee_id
)
@issue
=
Issue
.
find
(
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@previous_assignee
=
User
.
find_by_id
(
previous_assignee_id
)
if
previous_assignee_id
@previous_assignee
=
User
.
find_by_id
(
previous_assignee_id
)
if
previous_assignee_id
@project
=
@issue
.
project
@project
=
@issue
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
c
hanged issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
C
hanged issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
end
end
def
closed_issue_email
(
recipient_id
,
issue_id
,
updated_by_user_id
)
def
closed_issue_email
(
recipient_id
,
issue_id
,
updated_by_user_id
)
...
@@ -27,7 +27,7 @@ module Emails
...
@@ -27,7 +27,7 @@ module Emails
@project
=
@issue
.
project
@project
=
@issue
.
project
@updated_by
=
User
.
find
updated_by_user_id
@updated_by
=
User
.
find
updated_by_user_id
mail
(
to:
recipient
(
recipient_id
),
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
c
hanged issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
subject:
subject
(
"
C
hanged issue #
#{
@issue
.
iid
}
"
,
@issue
.
title
))
end
end
end
end
end
end
app/mailers/emails/merge_requests.rb
View file @
ea3680ad
...
@@ -2,24 +2,24 @@ module Emails
...
@@ -2,24 +2,24 @@ module Emails
module
MergeRequests
module
MergeRequests
def
new_merge_request_email
(
recipient_id
,
merge_request_id
)
def
new_merge_request_email
(
recipient_id
,
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
new merge request !
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
New merge request #
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
end
end
def
reassigned_merge_request_email
(
recipient_id
,
merge_request_id
,
previous_assignee_id
)
def
reassigned_merge_request_email
(
recipient_id
,
merge_request_id
,
previous_assignee_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@previous_assignee
=
User
.
find_by_id
(
previous_assignee_id
)
if
previous_assignee_id
@previous_assignee
=
User
.
find_by_id
(
previous_assignee_id
)
if
previous_assignee_id
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
changed merge request !
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
Changed merge request #
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
end
end
def
closed_merge_request_email
(
recipient_id
,
merge_request_id
,
updated_by_user_id
)
def
closed_merge_request_email
(
recipient_id
,
merge_request_id
,
updated_by_user_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@updated_by
=
User
.
find
updated_by_user_id
@updated_by
=
User
.
find
updated_by_user_id
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Closed merge request
!
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Closed merge request
#
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
end
end
def
merged_merge_request_email
(
recipient_id
,
merge_request_id
)
def
merged_merge_request_email
(
recipient_id
,
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Accepted merge request
!
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Accepted merge request
#
#{
@merge_request
.
iid
}
"
,
@merge_request
.
title
))
end
end
end
end
...
...
app/mailers/emails/notes.rb
View file @
ea3680ad
...
@@ -4,27 +4,27 @@ module Emails
...
@@ -4,27 +4,27 @@ module Emails
@note
=
Note
.
find
(
note_id
)
@note
=
Note
.
find
(
note_id
)
@commit
=
@note
.
noteable
@commit
=
@note
.
noteable
@project
=
@note
.
project
@project
=
@note
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ote for commit
#{
@commit
.
short_id
}
"
,
@commit
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ote for commit
#{
@commit
.
short_id
}
"
,
@commit
.
title
))
end
end
def
note_issue_email
(
recipient_id
,
note_id
)
def
note_issue_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@note
=
Note
.
find
(
note_id
)
@issue
=
@note
.
noteable
@issue
=
@note
.
noteable
@project
=
@note
.
project
@project
=
@note
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ote for issue #
#{
@issue
.
iid
}
"
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ote for issue #
#{
@issue
.
iid
}
"
))
end
end
def
note_merge_request_email
(
recipient_id
,
note_id
)
def
note_merge_request_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@note
=
Note
.
find
(
note_id
)
@merge_request
=
@note
.
noteable
@merge_request
=
@note
.
noteable
@project
=
@note
.
project
@project
=
@note
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ote for merge request #
#{
@merge_request
.
iid
}
"
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ote for merge request #
#{
@merge_request
.
iid
}
"
))
end
end
def
note_wall_email
(
recipient_id
,
note_id
)
def
note_wall_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@note
=
Note
.
find
(
note_id
)
@project
=
@note
.
project
@project
=
@note
.
project
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
n
ote on wall"
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"
N
ote on wall"
))
end
end
end
end
end
end
app/mailers/emails/projects.rb
View file @
ea3680ad
...
@@ -4,14 +4,14 @@ module Emails
...
@@ -4,14 +4,14 @@ module Emails
@users_project
=
UsersProject
.
find
user_project_id
@users_project
=
UsersProject
.
find
user_project_id
@project
=
@users_project
.
project
@project
=
@users_project
.
project
mail
(
to:
@users_project
.
user
.
email
,
mail
(
to:
@users_project
.
user
.
email
,
subject:
subject
(
"
a
ccess to project was granted"
))
subject:
subject
(
"
A
ccess to project was granted"
))
end
end
def
project_was_moved_email
(
project_id
,
user_id
)
def
project_was_moved_email
(
project_id
,
user_id
)
@user
=
User
.
find
user_id
@user
=
User
.
find
user_id
@project
=
Project
.
find
project_id
@project
=
Project
.
find
project_id
mail
(
to:
@user
.
email
,
mail
(
to:
@user
.
email
,
subject:
subject
(
"
p
roject was moved"
))
subject:
subject
(
"
P
roject was moved"
))
end
end
end
end
end
end
app/views/notify/new_merge_request_email.html.haml
View file @
ea3680ad
%p
%p
=
"New Merge Request
!
#{
@merge_request
.
iid
}
"
=
"New Merge Request
#
#{
@merge_request
.
iid
}
"
%p
%p
=
link_to_gfm
truncate
(
@merge_request
.
title
,
length:
40
),
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
=
link_to_gfm
truncate
(
@merge_request
.
title
,
length:
40
),
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
%p
%p
...
...
app/views/notify/new_merge_request_email.text.erb
View file @
ea3680ad
New Merge Request
<%=
@merge_request
.
iid
%>
New Merge Request
#
<%=
@merge_request
.
iid
%>
<%=
url_for
(
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
))
%>
<%=
url_for
(
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
))
%>
...
...
app/views/notify/reassigned_merge_request_email.html.haml
View file @
ea3680ad
%p
%p
=
"Reassigned Merge Request
!
#{
@merge_request
.
iid
}
"
=
"Reassigned Merge Request
#
#{
@merge_request
.
iid
}
"
=
link_to_gfm
truncate
(
@merge_request
.
title
,
length:
30
),
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
=
link_to_gfm
truncate
(
@merge_request
.
title
,
length:
30
),
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
%p
%p
Assignee changed
Assignee changed
...
...
app/views/notify/reassigned_merge_request_email.text.erb
View file @
ea3680ad
Reassigned Merge Request
<%=
@merge_request
.
iid
%>
Reassigned Merge Request
#
<%=
@merge_request
.
iid
%>
<%=
url_for
(
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
))
%>
<%=
url_for
(
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
))
%>
...
...
spec/mailers/notify_spec.rb
View file @
ea3680ad
...
@@ -110,7 +110,7 @@ describe Notify do
...
@@ -110,7 +110,7 @@ describe Notify do
it_behaves_like
'an assignee email'
it_behaves_like
'an assignee email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
#{
project
.
name
}
\|
n
ew issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/
should
have_subject
/
#{
project
.
name
}
\|
N
ew issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/
end
end
it
'contains a link to the new issue'
do
it
'contains a link to the new issue'
do
...
@@ -126,7 +126,7 @@ describe Notify do
...
@@ -126,7 +126,7 @@ describe Notify do
it_behaves_like
'a multiple recipients email'
it_behaves_like
'a multiple recipients email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
c
hanged issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/
should
have_subject
/
C
hanged issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/
end
end
it
'contains the name of the previous assignee'
do
it
'contains the name of the previous assignee'
do
...
@@ -148,7 +148,7 @@ describe Notify do
...
@@ -148,7 +148,7 @@ describe Notify do
subject
{
Notify
.
issue_status_changed_email
(
recipient
.
id
,
issue
.
id
,
status
,
current_user
)
}
subject
{
Notify
.
issue_status_changed_email
(
recipient
.
id
,
issue
.
id
,
status
,
current_user
)
}
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
c
hanged issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/i
should
have_subject
/
C
hanged issue #
#{
issue
.
iid
}
\|
#{
issue
.
title
}
/i
end
end
it
'contains the new status'
do
it
'contains the new status'
do
...
@@ -175,7 +175,7 @@ describe Notify do
...
@@ -175,7 +175,7 @@ describe Notify do
it_behaves_like
'an assignee email'
it_behaves_like
'an assignee email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
new merge request !
#{
merge_request
.
iid
}
/
should
have_subject
/
New merge request #
#{
merge_request
.
iid
}
/
end
end
it
'contains a link to the new merge request'
do
it
'contains a link to the new merge request'
do
...
@@ -199,7 +199,7 @@ describe Notify do
...
@@ -199,7 +199,7 @@ describe Notify do
it_behaves_like
'a multiple recipients email'
it_behaves_like
'a multiple recipients email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
changed merge request !
#{
merge_request
.
iid
}
/
should
have_subject
/
Changed merge request #
#{
merge_request
.
iid
}
/
end
end
it
'contains the name of the previous assignee'
do
it
'contains the name of the previous assignee'
do
...
@@ -224,7 +224,7 @@ describe Notify do
...
@@ -224,7 +224,7 @@ describe Notify do
subject
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
)
}
subject
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
)
}
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
p
roject was moved/
should
have_subject
/
P
roject was moved/
end
end
it
'contains name of project'
do
it
'contains name of project'
do
...
@@ -244,7 +244,7 @@ describe Notify do
...
@@ -244,7 +244,7 @@ describe Notify do
user:
user
)
}
user:
user
)
}
subject
{
Notify
.
project_access_granted_email
(
users_project
.
id
)
}
subject
{
Notify
.
project_access_granted_email
(
users_project
.
id
)
}
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
a
ccess to project was granted/
should
have_subject
/
A
ccess to project was granted/
end
end
it
'contains name of project'
do
it
'contains name of project'
do
should
have_body_text
/
#{
project
.
name
}
/
should
have_body_text
/
#{
project
.
name
}
/
...
@@ -302,7 +302,7 @@ describe Notify do
...
@@ -302,7 +302,7 @@ describe Notify do
it_behaves_like
'a note email'
it_behaves_like
'a note email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
n
ote for commit
#{
commit
.
short_id
}
/
should
have_subject
/
N
ote for commit
#{
commit
.
short_id
}
/
end
end
it
'contains a link to the commit'
do
it
'contains a link to the commit'
do
...
@@ -320,7 +320,7 @@ describe Notify do
...
@@ -320,7 +320,7 @@ describe Notify do
it_behaves_like
'a note email'
it_behaves_like
'a note email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
n
ote for merge request #
#{
merge_request
.
iid
}
/
should
have_subject
/
N
ote for merge request #
#{
merge_request
.
iid
}
/
end
end
it
'contains a link to the merge request note'
do
it
'contains a link to the merge request note'
do
...
@@ -338,7 +338,7 @@ describe Notify do
...
@@ -338,7 +338,7 @@ describe Notify do
it_behaves_like
'a note email'
it_behaves_like
'a note email'
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
n
ote for issue #
#{
issue
.
iid
}
/
should
have_subject
/
N
ote for issue #
#{
issue
.
iid
}
/
end
end
it
'contains a link to the issue note'
do
it
'contains a link to the issue note'
do
...
@@ -356,7 +356,7 @@ describe Notify do
...
@@ -356,7 +356,7 @@ describe Notify do
subject
{
Notify
.
group_access_granted_email
(
membership
.
id
)
}
subject
{
Notify
.
group_access_granted_email
(
membership
.
id
)
}
it
'has the correct subject'
do
it
'has the correct subject'
do
should
have_subject
/
a
ccess to group was granted/
should
have_subject
/
A
ccess to group was granted/
end
end
it
'contains name of project'
do
it
'contains name of project'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment