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
4d655321
Commit
4d655321
authored
Aug 29, 2012
by
Alex Denisov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue_status_changed email added
parent
8da05a4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
0 deletions
+47
-0
app/mailers/notify.rb
app/mailers/notify.rb
+8
-0
app/views/notify/issue_status_changed_email.html.haml
app/views/notify/issue_status_changed_email.html.haml
+16
-0
spec/mailers/notify_spec.rb
spec/mailers/notify_spec.rb
+23
-0
No files found.
app/mailers/notify.rb
View file @
4d655321
...
...
@@ -83,6 +83,14 @@ class Notify < ActionMailer::Base
subject:
subject
(
"access to project was granted"
))
end
def
issue_status_changed_email
(
recipient_id
,
issue_id
,
status
,
updated_by_user_id
)
@issue
=
Issue
.
find
issue_id
@issue_status
=
status
@updated_by
=
User
.
find
updated_by_user_id
mail
(
to:
recipient
(
recipient_id
),
subject:
subject
(
"changed issue #
#{
@issue
.
id
}
"
,
@issue
.
title
))
end
private
# Look up a User by their ID and return their email address
...
...
app/views/notify/issue_status_changed_email.html.haml
0 → 100644
View file @
4d655321
%td
.content
{
align:
"left"
,
style:
"font-family: Helvetica, Arial, sans-serif; padding: 20px 0 0;"
,
valign:
"top"
,
width:
"600"
}
%table
{
border:
"0"
,
cellpadding:
"0"
,
cellspacing:
"0"
,
style:
"color: #717171; font: normal 11px Helvetica, Arial, sans-serif; margin: 0; padding: 0;"
,
width:
"600"
}
%tr
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%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; "
}
=
"Issue was
#{
@issue_status
}
by
#{
@updated_by
.
name
}
"
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%tr
%td
{
style:
"font-size: 1px; line-height: 1px;"
,
width:
"21"
}
%td
{
align:
"left"
,
style:
"padding: 20px 0 0;"
}
%h2
{
style:
"color:#646464 !important; font-weight: bold; margin: 0; padding: 0; line-height: 26px; font-size: 18px; font-family: Helvetica, Arial, sans-serif; "
}
=
"Issue #
#{
@issue
.
id
}
"
=
link_to_gfm
truncate
(
@issue
.
title
,
length:
45
),
project_issue_url
(
@issue
.
project
,
@issue
),
title:
@issue
.
title
%br
spec/mailers/notify_spec.rb
View file @
4d655321
...
...
@@ -91,6 +91,29 @@ describe Notify do
should
have_body_text
/
#{
project_issue_path
project
,
issue
}
/
end
end
describe
'status changed'
do
let
(
:current_user
)
{
Factory
.
create
:user
,
email:
"current@email.com"
}
let
(
:status
)
{
'closed'
}
subject
{
Notify
.
issue_status_changed_email
(
recipient
.
id
,
issue
.
id
,
status
,
current_user
)
}
it
'has the correct subject'
do
should
have_subject
/changed issue #
#{
issue
.
id
}
\|
#{
issue
.
title
}
/i
end
it
'contains the new status'
do
should
have_body_text
/
#{
status
}
/i
end
it
'contains the user name'
do
should
have_body_text
/
#{
current_user
.
name
}
/i
end
it
'contains a link to the issue'
do
should
have_body_text
/
#{
project_issue_path
project
,
issue
}
/
end
end
end
context
'for merge requests'
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