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
310231db
Commit
310231db
authored
Jul 03, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reopen mr email notification.
parent
1208c6ca
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
0 deletions
+28
-0
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+13
-0
app/services/merge_requests/reopen_service.rb
app/services/merge_requests/reopen_service.rb
+1
-0
app/services/notification_service.rb
app/services/notification_service.rb
+4
-0
app/views/notify/merge_request_status_email.html.haml
app/views/notify/merge_request_status_email.html.haml
+2
-0
app/views/notify/merge_request_status_email.text.haml
app/views/notify/merge_request_status_email.text.haml
+8
-0
No files found.
app/mailers/emails/merge_requests.rb
View file @
310231db
...
...
@@ -41,6 +41,19 @@ module Emails
to:
recipient
(
recipient_id
),
subject:
subject
(
"
#{
@merge_request
.
title
}
(#
#{
@merge_request
.
iid
}
)"
))
end
def
merge_request_status_email
(
recipient_id
,
merge_request_id
,
status
,
updated_by_user_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@mr_status
=
status
@project
=
@merge_request
.
project
@updated_by
=
User
.
find
updated_by_user_id
@target_url
=
project_merge_request_url
(
@project
,
@merge_request
)
set_reference
(
"merge_request_
#{
merge_request_id
}
"
)
mail
(
from:
sender
(
updated_by_user_id
),
to:
recipient
(
recipient_id
),
subject:
subject
(
"
#{
@merge_request
.
title
}
(#
#{
@merge_request
.
iid
}
)
#{
@mr_status
}
"
))
end
end
# Over rides default behavour to show source/target
...
...
app/services/merge_requests/reopen_service.rb
View file @
310231db
...
...
@@ -3,6 +3,7 @@ module MergeRequests
def
execute
(
merge_request
)
if
merge_request
.
reopen
event_service
.
reopen_mr
(
merge_request
,
current_user
)
notification_service
.
reopen_mr
(
merge_request
,
current_user
)
create_note
(
merge_request
)
execute_hooks
(
merge_request
)
merge_request
.
reload_code
...
...
app/services/notification_service.rb
View file @
310231db
...
...
@@ -99,6 +99,10 @@ class NotificationService
end
end
def
reopen_mr
(
merge_request
,
current_user
)
reopen_resource_email
(
merge_request
,
merge_request
.
target_project
,
current_user
,
'merge_request_status_email'
,
'reopened'
)
end
# Notify new user with email after creation
def
new_user
(
user
)
# Don't email omniauth created users
...
...
app/views/notify/merge_request_status_email.html.haml
0 → 100644
View file @
310231db
%p
=
"Merge Request #
#{
@merge_request
.
iid
}
was
#{
@mr_status
}
by
#{
@updated_by
.
name
}
"
app/views/notify/merge_request_status_email.text.haml
0 → 100644
View file @
310231db
=
"Merge Request #
#{
@merge_request
.
iid
}
was
#{
@mr_status
}
by
#{
@updated_by
.
name
}
"
Merge Request url:
#{
project_merge_request_url
(
@merge_request
.
target_project
,
@merge_request
)
}
=
merge_path_description
(
@merge_request
,
'to'
)
Author:
#{
@merge_request
.
author_name
}
Assignee:
#{
@merge_request
.
assignee_name
}
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