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
Tatuya Kamada
gitlab-ce
Commits
e660043d
Commit
e660043d
authored
May 15, 2012
by
Robb Kidd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make Notify#new_merge_request_email resque friendly.
parent
39061af9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
10 deletions
+6
-10
app/mailers/notify.rb
app/mailers/notify.rb
+3
-5
app/views/notify/new_merge_request_email.html.haml
app/views/notify/new_merge_request_email.html.haml
+2
-4
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+1
-1
No files found.
app/mailers/notify.rb
View file @
e660043d
...
@@ -45,11 +45,9 @@ class Notify < ActionMailer::Base
...
@@ -45,11 +45,9 @@ class Notify < ActionMailer::Base
mail
(
:to
=>
recipient
.
email
,
:subject
=>
"gitlab | note for issue
#{
@issue
.
id
}
|
#{
@note
.
project_name
}
"
)
mail
(
:to
=>
recipient
.
email
,
:subject
=>
"gitlab | note for issue
#{
@issue
.
id
}
|
#{
@note
.
project_name
}
"
)
end
end
def
new_merge_request_email
(
merge_request
)
def
new_merge_request_email
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request
[
'id'
])
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@user
=
@merge_request
.
assignee
mail
(
:to
=>
@merge_request
.
assignee_email
,
:subject
=>
"gitlab | new merge request |
#{
@merge_request
.
title
}
"
)
@project
=
@merge_request
.
project
mail
(
:to
=>
@user
.
email
,
:subject
=>
"gitlab | new merge request |
#{
@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
)
...
...
app/views/notify/new_merge_request_email.html.haml
View file @
e660043d
...
@@ -5,16 +5,14 @@
...
@@ -5,16 +5,14 @@
%td
{
:align
=>
"left"
,
:style
=>
"padding: 20px 0 0;"
}
%td
{
:align
=>
"left"
,
:style
=>
"padding: 20px 0 0;"
}
%h2
{
:style
=>
"color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "
}
%h2
{
:style
=>
"color:#646464; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "
}
New Merge Request
New Merge Request
=
link_to
truncate
(
@merge_request
.
title
,
:length
=>
16
),
project_merge_request_url
(
@project
,
@merge_request
)
=
link_to
truncate
(
@merge_request
.
title
,
:length
=>
16
),
project_merge_request_url
(
@
merge_request
.
project
,
@merge_request
)
%td
{
:style
=>
"font-size: 1px; line-height: 1px;"
,
:width
=>
"21"
}
%td
{
:style
=>
"font-size: 1px; line-height: 1px;"
,
:width
=>
"21"
}
%tr
%tr
%td
{
:style
=>
"font-size: 1px; line-height: 1px;"
,
:width
=>
"21"
}
%td
{
:style
=>
"font-size: 1px; line-height: 1px;"
,
:width
=>
"21"
}
%td
{
:style
=>
"padding: 15px 0 15px;"
,
:valign
=>
"top"
}
%td
{
:style
=>
"padding: 15px 0 15px;"
,
:valign
=>
"top"
}
%p
{
:style
=>
"color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "
}
%p
{
:style
=>
"color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "
}
Branches:
#{
@merge_request
.
source_branch
}
→
#{
@merge_request
.
target_branch
}
Branches:
#{
@merge_request
.
source_branch
}
→
#{
@merge_request
.
target_branch
}
%p
{
:style
=>
"color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "
}
%p
{
:style
=>
"color:#767676; font-weight: normal; margin: 0; padding: 0; line-height: 20px; font-size: 12px;font-family: Helvetica, Arial, sans-serif; "
}
Asignee:
#{
@merge_request
.
author
.
name
}
→
#{
@merge_request
.
assignee
.
name
}
Asignee:
#{
@merge_request
.
author_name
}
→
#{
@merge_request
.
assignee_name
}
%td
%td
spec/mailers/notify_spec.rb
View file @
e660043d
...
@@ -101,7 +101,7 @@ describe Notify do
...
@@ -101,7 +101,7 @@ describe Notify do
let
(
:merge_request
)
{
Factory
.
create
(
:merge_request
,
:assignee
=>
assignee
,
:project
=>
project
)
}
let
(
:merge_request
)
{
Factory
.
create
(
:merge_request
,
:assignee
=>
assignee
,
:project
=>
project
)
}
describe
'that are new'
do
describe
'that are new'
do
subject
{
Notify
.
new_merge_request_email
(
merge_request
)
}
subject
{
Notify
.
new_merge_request_email
(
merge_request
.
id
)
}
it_behaves_like
'an assignee email'
it_behaves_like
'an assignee email'
...
...
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