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
Léo-Paul Géneau
gitlab-ce
Commits
e90d6ec1
Commit
e90d6ec1
authored
Mar 15, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create a SentNotification record for #relabeled_issue_email / #relabeled_merge_request_email
parent
c98089b2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
app/controllers/concerns/toggle_subscription_action.rb
app/controllers/concerns/toggle_subscription_action.rb
+17
-0
app/mailers/emails/issues.rb
app/mailers/emails/issues.rb
+3
-5
app/mailers/emails/merge_requests.rb
app/mailers/emails/merge_requests.rb
+3
-5
No files found.
app/controllers/concerns/toggle_subscription_action.rb
0 → 100644
View file @
e90d6ec1
module
ToggleSubscriptionAction
extend
ActiveSupport
::
Concern
def
toggle_subscription
return
unless
current_user
subscribable_resource
.
toggle_subscription
(
current_user
)
render
nothing:
true
end
private
def
subscribable_resource
raise
NotImplementedError
end
end
app/mailers/emails/issues.rb
View file @
e90d6ec1
...
@@ -21,7 +21,7 @@ module Emails
...
@@ -21,7 +21,7 @@ module Emails
end
end
def
relabeled_issue_email
(
recipient_id
,
issue_id
,
label_names
,
updated_by_user_id
)
def
relabeled_issue_email
(
recipient_id
,
issue_id
,
label_names
,
updated_by_user_id
)
setup_issue_mail
(
issue_id
,
recipient_id
,
sent_notification:
false
)
setup_issue_mail
(
issue_id
,
recipient_id
)
@label_names
=
label_names
@label_names
=
label_names
@labels_url
=
namespace_project_labels_url
(
@project
.
namespace
,
@project
)
@labels_url
=
namespace_project_labels_url
(
@project
.
namespace
,
@project
)
...
@@ -38,14 +38,12 @@ module Emails
...
@@ -38,14 +38,12 @@ module Emails
private
private
def
setup_issue_mail
(
issue_id
,
recipient_id
,
sent_notification:
true
)
def
setup_issue_mail
(
issue_id
,
recipient_id
)
@issue
=
Issue
.
find
(
issue_id
)
@issue
=
Issue
.
find
(
issue_id
)
@project
=
@issue
.
project
@project
=
@issue
.
project
@target_url
=
namespace_project_issue_url
(
@project
.
namespace
,
@project
,
@issue
)
@target_url
=
namespace_project_issue_url
(
@project
.
namespace
,
@project
,
@issue
)
if
sent_notification
@sent_notification
=
SentNotification
.
record
(
@issue
,
recipient_id
,
reply_key
)
@sent_notification
=
SentNotification
.
record
(
@issue
,
recipient_id
,
reply_key
)
end
end
end
def
issue_thread_options
(
sender_id
,
recipient_id
)
def
issue_thread_options
(
sender_id
,
recipient_id
)
...
...
app/mailers/emails/merge_requests.rb
View file @
e90d6ec1
...
@@ -14,7 +14,7 @@ module Emails
...
@@ -14,7 +14,7 @@ module Emails
end
end
def
relabeled_merge_request_email
(
recipient_id
,
merge_request_id
,
label_names
,
updated_by_user_id
)
def
relabeled_merge_request_email
(
recipient_id
,
merge_request_id
,
label_names
,
updated_by_user_id
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
,
sent_notification:
false
)
setup_merge_request_mail
(
merge_request_id
,
recipient_id
)
@label_names
=
label_names
@label_names
=
label_names
@labels_url
=
namespace_project_labels_url
(
@project
.
namespace
,
@project
)
@labels_url
=
namespace_project_labels_url
(
@project
.
namespace
,
@project
)
...
@@ -44,14 +44,12 @@ module Emails
...
@@ -44,14 +44,12 @@ module Emails
private
private
def
setup_merge_request_mail
(
merge_request_id
,
recipient_id
,
sent_notification:
true
)
def
setup_merge_request_mail
(
merge_request_id
,
recipient_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@merge_request
=
MergeRequest
.
find
(
merge_request_id
)
@project
=
@merge_request
.
project
@project
=
@merge_request
.
project
@target_url
=
namespace_project_merge_request_url
(
@project
.
namespace
,
@project
,
@merge_request
)
@target_url
=
namespace_project_merge_request_url
(
@project
.
namespace
,
@project
,
@merge_request
)
if
sent_notification
@sent_notification
=
SentNotification
.
record
(
@merge_request
,
recipient_id
,
reply_key
)
@sent_notification
=
SentNotification
.
record
(
@merge_request
,
recipient_id
,
reply_key
)
end
end
end
def
merge_request_thread_options
(
sender_id
,
recipient_id
)
def
merge_request_thread_options
(
sender_id
,
recipient_id
)
...
...
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