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
Léo-Paul Géneau
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
@group
=
@membership
.
group
mail
(
to:
@membership
.
user
.
email
,
subject:
subject
(
"
a
ccess to group was granted"
))
subject:
subject
(
"
A
ccess to group was granted"
))
end
end
end
app/mailers/emails/issues.rb
View file @
ea3680ad
...
...
@@ -3,14 +3,14 @@ module Emails
def
new_issue_email
(
recipient_id
,
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@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
def
reassigned_issue_email
(
recipient_id
,
issue_id
,
previous_assignee_id
)
@issue
=
Issue
.
find
(
issue_id
)
@previous_assignee
=
User
.
find_by_id
(
previous_assignee_id
)
if
previous_assignee_id
@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
def
closed_issue_email
(
recipient_id
,
issue_id
,
updated_by_user_id
)
...
...
@@ -27,7 +27,7 @@ module Emails
@project
=
@issue
.
project
@updated_by
=
User
.
find
updated_by_user_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
app/mailers/emails/merge_requests.rb
View file @
ea3680ad
...
...
@@ -2,24 +2,24 @@ module Emails
module
MergeRequests
def
new_merge_request_email
(
recipient_id
,
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
def
reassigned_merge_request_email
(
recipient_id
,
merge_request_id
,
previous_assignee_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_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
def
closed_merge_request_email
(
recipient_id
,
merge_request_id
,
updated_by_user_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_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
def
merged_merge_request_email
(
recipient_id
,
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
...
...
app/mailers/emails/notes.rb
View file @
ea3680ad
...
...
@@ -4,27 +4,27 @@ module Emails
@note
=
Note
.
find
(
note_id
)
@commit
=
@note
.
noteable
@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
def
note_issue_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@issue
=
@note
.
noteable
@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
def
note_merge_request_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@merge_request
=
@note
.
noteable
@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
def
note_wall_email
(
recipient_id
,
note_id
)
@note
=
Note
.
find
(
note_id
)
@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
app/mailers/emails/projects.rb
View file @
ea3680ad
...
...
@@ -4,14 +4,14 @@ module Emails
@users_project
=
UsersProject
.
find
user_project_id
@project
=
@users_project
.
project
mail
(
to:
@users_project
.
user
.
email
,
subject:
subject
(
"
a
ccess to project was granted"
))
subject:
subject
(
"
A
ccess to project was granted"
))
end
def
project_was_moved_email
(
project_id
,
user_id
)
@user
=
User
.
find
user_id
@project
=
Project
.
find
project_id
mail
(
to:
@user
.
email
,
subject:
subject
(
"
p
roject was moved"
))
subject:
subject
(
"
P
roject was moved"
))
end
end
end
app/views/notify/new_merge_request_email.html.haml
View file @
ea3680ad
%p
=
"New Merge Request
!
#{
@merge_request
.
iid
}
"
=
"New Merge Request
#
#{
@merge_request
.
iid
}
"
%p
=
link_to_gfm
truncate
(
@merge_request
.
title
,
length:
40
),
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
%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
))
%>
...
...
app/views/notify/reassigned_merge_request_email.html.haml
View file @
ea3680ad
%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
)
%p
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
))
%>
...
...
spec/mailers/notify_spec.rb
View file @
ea3680ad
...
...
@@ -110,7 +110,7 @@ describe Notify do
it_behaves_like
'an assignee email'
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
it
'contains a link to the new issue'
do
...
...
@@ -126,7 +126,7 @@ describe Notify do
it_behaves_like
'a multiple recipients email'
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
it
'contains the name of the previous assignee'
do
...
...
@@ -148,7 +148,7 @@ describe Notify do
subject
{
Notify
.
issue_status_changed_email
(
recipient
.
id
,
issue
.
id
,
status
,
current_user
)
}
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
it
'contains the new status'
do
...
...
@@ -175,7 +175,7 @@ describe Notify do
it_behaves_like
'an assignee email'
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
it
'contains a link to the new merge request'
do
...
...
@@ -199,7 +199,7 @@ describe Notify do
it_behaves_like
'a multiple recipients email'
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
it
'contains the name of the previous assignee'
do
...
...
@@ -224,7 +224,7 @@ describe Notify do
subject
{
Notify
.
project_was_moved_email
(
project
.
id
,
user
.
id
)
}
it
'has the correct subject'
do
should
have_subject
/
p
roject was moved/
should
have_subject
/
P
roject was moved/
end
it
'contains name of project'
do
...
...
@@ -244,7 +244,7 @@ describe Notify do
user:
user
)
}
subject
{
Notify
.
project_access_granted_email
(
users_project
.
id
)
}
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
it
'contains name of project'
do
should
have_body_text
/
#{
project
.
name
}
/
...
...
@@ -302,7 +302,7 @@ describe Notify do
it_behaves_like
'a note email'
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
it
'contains a link to the commit'
do
...
...
@@ -320,7 +320,7 @@ describe Notify do
it_behaves_like
'a note email'
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
it
'contains a link to the merge request note'
do
...
...
@@ -338,7 +338,7 @@ describe Notify do
it_behaves_like
'a note email'
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
it
'contains a link to the issue note'
do
...
...
@@ -356,7 +356,7 @@ describe Notify do
subject
{
Notify
.
group_access_granted_email
(
membership
.
id
)
}
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
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