Commits

Haru Iida  committed be7835f

fixes #1185 Mail notify does not work with wiki comment.

  • Participants
  • Parent commits 8f89129
  • Tags 0.6.2

Comments (0)

Files changed (2)

File app/models/wiki_extensions_comments_mailer.rb

                     'Author' => author
     message_id wiki_page
     # Send notification to watchers of wiki page
-    recipients wiki_page.watchers.collect{|watcher| watcher.user.mail}
-    subject "[#{project.name} - Wiki - #{wiki_page.title}] commented"
-    body = {
-      :project => project,
-      :author => author,
-      :text => text,
-      :wiki_page_title => wiki_page.title,
-      :wiki_page_url => url_for(:controller => 'wiki', :action => 'show', :project_id => project, :id => wiki_page.title)
-    }
-    render_multipart('wiki_commented', body)
+    recipients = wiki_page.watchers.collect { |watcher| watcher.user.mail }
+
+    subject = "[#{project.name} - Wiki - #{wiki_page.title}] commented"
+
+    @project = project
+    @author = author
+    @text = text
+    @wiki_page_title = wiki_page.title
+    @wiki_page_url = url_for(:controller => 'wiki', :action => 'show', :project_id => project, :id => wiki_page.title)
+
+    mail :to => recipients,
+         :subject => subject
+
   end
 end

File app/views/wiki_extensions_comments_mailer/wiki_commented.html.erb

 l(:wiki_page_commented_url)
 %>
 <br />
-<%=
-"<a href=\"" + @wiki_page_url + "\">" + @wiki_page_url + "<a/>"
-%>
+<%= link_to(h(@wiki_page_url),  @wiki_page_url)
+-%>