summaryrefslogtreecommitdiff
path: root/app/mailers/emails/issues.rb
diff options
context:
space:
mode:
authorTimothy Andrew <mail@timothyandrew.net>2016-02-12 20:28:39 +0530
committerRémy Coutable <remy@rymai.me>2016-03-15 17:25:37 +0100
commit0444fa560acd07255960284f19b1de6499cd5910 (patch)
tree005ce576bbe661242ee58c1e1ddebd9e665bd9ff /app/mailers/emails/issues.rb
parent178c80a561fa10a157bae6e5d4682b232ae727c7 (diff)
downloadgitlab-ce-0444fa560acd07255960284f19b1de6499cd5910.tar.gz
Original implementation to allow users to subscribe to labels
1. Allow subscribing (the current user) to a label - Refactor the `Subscription` coffeescript class - The main change is that it accepts a container, and conducts all DOM queries within its scope. We need this because the labels page has multiple instances of `Subscription` on the same page. 2. Creating an issue or MR with labels notifies users subscribed to those labels - Label `has_many` subscribers through subscriptions. 3. Adding a label to an issue or MR notifies users subscribed to those labels - This only applies to subscribers of the label that has just been added, not all labels for the issue.
Diffstat (limited to 'app/mailers/emails/issues.rb')
-rw-r--r--app/mailers/emails/issues.rb11
1 files changed, 9 insertions, 2 deletions
diff --git a/app/mailers/emails/issues.rb b/app/mailers/emails/issues.rb
index 4a88cb61132..2838baa1b4e 100644
--- a/app/mailers/emails/issues.rb
+++ b/app/mailers/emails/issues.rb
@@ -16,7 +16,14 @@ module Emails
def closed_issue_email(recipient_id, issue_id, updated_by_user_id)
setup_issue_mail(issue_id, recipient_id)
- @updated_by = User.find updated_by_user_id
+ @updated_by = User.find(updated_by_user_id)
+ mail_answer_thread(@issue, issue_thread_options(updated_by_user_id, recipient_id))
+ end
+
+ def relabeled_issue_email(recipient_id, issue_id, updated_by_user_id, label_names)
+ setup_issue_mail(issue_id, recipient_id)
+ @label_names = label_names
+ @updated_by = User.find(updated_by_user_id)
mail_answer_thread(@issue, issue_thread_options(updated_by_user_id, recipient_id))
end
@@ -24,7 +31,7 @@ module Emails
setup_issue_mail(issue_id, recipient_id)
@issue_status = status
- @updated_by = User.find updated_by_user_id
+ @updated_by = User.find(updated_by_user_id)
mail_answer_thread(@issue, issue_thread_options(updated_by_user_id, recipient_id))
end