BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
10 deletions
+6
-10
notify.rb
app/mailers/notify.rb
+3
-5
new_merge_request_email.html.haml
app/views/notify/new_merge_request_email.html.haml
+2
-4
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
mail
(
:to
=>
recipient
.
email
,
:subject
=>
"gitlab | note for issue
#{
@issue
.
id
}
|
#{
@note
.
project_name
}
"
)
end
def
new_merge_request_email
(
merge_request
)
@merge_request
=
MergeRequest
.
find
(
merge_request
[
'id'
])
@user
=
@merge_request
.
assignee
@project
=
@merge_request
.
project
mail
(
:to
=>
@user
.
email
,
:subject
=>
"gitlab | new merge request |
#{
@merge_request
.
title
}
"
)
def
new_merge_request_email
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
mail
(
:to
=>
@merge_request
.
assignee_email
,
:subject
=>
"gitlab | new merge request |
#{
@merge_request
.
title
}
"
)
end
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 @@
%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; "
}
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"
}
%tr
%td
{
:style
=>
"font-size: 1px; line-height: 1px;"
,
:width
=>
"21"
}
%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; "
}
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; "
}
Asignee:
#{
@merge_request
.
author
.
name
}
→
#{
@merge_request
.
assignee
.
name
}
Asignee:
#{
@merge_request
.
author_name
}
→
#{
@merge_request
.
assignee_name
}
%td
spec/mailers/notify_spec.rb
View file @
e660043d
...
...
@@ -101,7 +101,7 @@ describe Notify do
let
(
:merge_request
)
{
Factory
.
create
(
:merge_request
,
:assignee
=>
assignee
,
:project
=>
project
)
}
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'
...
...
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