]> git.openstreetmap.org Git - rails.git/blobdiff - app/models/notifier.rb
Set the reported_user in a callback
[rails.git] / app / models / notifier.rb
index 1eb39e67844a8b2295f343284030d7b75c303f40..54eb9b41852c71622f772a7fb4894558db31172e 100644 (file)
@@ -167,6 +167,7 @@ class Notifier < ActionMailer::Base
 
   def changeset_comment_notification(comment, recipient)
     with_recipient_locale recipient do
+      @to_user = recipient.display_name
       @changeset_url = changeset_url(comment.changeset, :host => SERVER_URL)
       @comment = comment.body
       @owner = recipient == comment.changeset.user
@@ -188,6 +189,17 @@ class Notifier < ActionMailer::Base
     end
   end
 
+  def new_issue_notification(issue_id, recipient)
+    with_recipient_locale recipient do
+      @url = url_for(:host => SERVER_URL,
+                     :controller => "issues",
+                     :action => "show",
+                     :id => issue_id)
+      subject = I18n.t("notifier.new_issue_notification.subject")
+      mail :to => recipient.email, :subject => subject
+    end
+  end
+
   private
 
   def set_shared_template_vars