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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0fcd89e3
Commit
0fcd89e3
authored
Aug 22, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show iids for issues/mr in email subject
parent
d2aa48c0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
app/mailers/emails/issues.rb
app/mailers/emails/issues.rb
+4
-4
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+4
-4
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+5
-5
No files found.
app/mailers/emails/issues.rb
View file @
0fcd89e3
...
@@ -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
(
"new issue #
#{
@issue
.
id
}
"
,
@issue
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"new issue #
#{
@issue
.
i
i
d
}
"
,
@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
(
"changed issue #
#{
@issue
.
id
}
"
,
@issue
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"changed issue #
#{
@issue
.
i
i
d
}
"
,
@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
)
...
@@ -18,7 +18,7 @@ module Emails
...
@@ -18,7 +18,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
(
"Closed issue #
#{
@issue
.
id
}
"
,
@issue
.
title
))
subject:
subject
(
"Closed issue #
#{
@issue
.
i
i
d
}
"
,
@issue
.
title
))
end
end
def
issue_status_changed_email
(
recipient_id
,
issue_id
,
status
,
updated_by_user_id
)
def
issue_status_changed_email
(
recipient_id
,
issue_id
,
status
,
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
(
"changed issue #
#{
@issue
.
id
}
"
,
@issue
.
title
))
subject:
subject
(
"changed issue #
#{
@issue
.
i
i
d
}
"
,
@issue
.
title
))
end
end
end
end
end
end
app/mailers/emails/merge_requests.rb
View file @
0fcd89e3
...
@@ -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
.
id
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"new merge request !
#{
@merge_request
.
i
i
d
}
"
,
@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
.
id
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"changed merge request !
#{
@merge_request
.
i
i
d
}
"
,
@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
.
id
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Closed merge request !
#{
@merge_request
.
i
i
d
}
"
,
@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
.
id
}
"
,
@merge_request
.
title
))
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"Accepted merge request !
#{
@merge_request
.
i
i
d
}
"
,
@merge_request
.
title
))
end
end
end
end
...
...
spec/mailers/notify_spec.rb
View file @
0fcd89e3
...
@@ -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
}
\| new issue #
#{
issue
.
id
}
\|
#{
issue
.
title
}
/
should
have_subject
/
#{
project
.
name
}
\| new issue #
#{
issue
.
i
i
d
}
\|
#{
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
/changed issue #
#{
issue
.
id
}
\|
#{
issue
.
title
}
/
should
have_subject
/changed issue #
#{
issue
.
i
i
d
}
\|
#{
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
/changed issue #
#{
issue
.
id
}
\|
#{
issue
.
title
}
/i
should
have_subject
/changed issue #
#{
issue
.
i
i
d
}
\|
#{
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
.
id
}
/
should
have_subject
/new merge request !
#{
merge_request
.
i
i
d
}
/
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
.
id
}
/
should
have_subject
/changed merge request !
#{
merge_request
.
i
i
d
}
/
end
end
it
'contains the name of the previous assignee'
do
it
'contains the name of the previous assignee'
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