Commit 7ce466a92327c45dfa8a61dfe75ebfbb731d0b2a

Authored by Antonio Terceiro
1 parent 59e2f02e

Rename Comment::Notifier to CommentNotifier

app/mailers/comment_notifier.rb
1   -class Comment::Notifier < ActionMailer::Base
  1 +class CommentNotifier < ActionMailer::Base
2 2 def notification(comment)
3 3 profile = comment.article.profile
4 4 @recipient = profile.nickname || profile.name
... ...
app/models/comment.rb
... ... @@ -132,11 +132,11 @@ class Comment &lt; ActiveRecord::Base
132 132 def notify_by_mail
133 133 if source.kind_of?(Article) && article.notify_comments?
134 134 if !notification_emails.empty?
135   - Comment::Notifier.notification(self).deliver
  135 + CommentNotifier.notification(self).deliver
136 136 end
137 137 emails = article.followers - [author_email]
138 138 if !emails.empty?
139   - Comment::Notifier.mail_to_followers(self, emails).deliver
  139 + CommentNotifier.mail_to_followers(self, emails).deliver
140 140 end
141 141 end
142 142 end
... ...
app/views/comment/notifier/mail_to_followers.html.erb
... ... @@ -1,22 +0,0 @@
1   -<%= _('Hi!') %>
2   -
3   -<%= word_wrap(_('%{sender} (%{sender_link}) commented on the content "%{article_title}".') % { :sender => @sender, :sender_link => url_for(@sender_link), :article_title => @article_title }) %>
4   -
5   -<%= word_wrap(_('Title: %s') % @comment_title) if @comment_title %>
6   -
7   -<%= _("Comment:") %>
8   --------------------------------------------------------------------------------
9   -<%= word_wrap(@comment_body) %>
10   --------------------------------------------------------------------------------
11   -
12   -<%= _('Click on the address below to view this comment:') %>
13   -<%= url_for @comment_url %>
14   -
15   -<%= _('Click on the address below to cancel the notification of new comments:') %>
16   -<%= url_for @unsubscribe_url %>
17   -
18   -<%= _("Greetings,") %>
19   -
20   ---
21   -<%= _('%s team.') % @environment %>
22   -<%= url_for @url %>
app/views/comment/notifier/notification.text.erb
... ... @@ -1,19 +0,0 @@
1   -<%= _('Hi, %{recipient}!') % { :recipient => @recipient } %>
2   -
3   -<%= word_wrap(_('%{sender} (%{sender_link}) created a new comment on your article "%{article_title}".') % { :sender => @sender, :sender_link => url_for(@sender_link), :article_title => @article_title }) %>
4   -
5   -<%= word_wrap(_('Title: %s') % @comment_title) %>
6   -
7   -<%= _("Comment:") %>
8   --------------------------------------------------------------------------------
9   -<%= word_wrap(@comment_body) %>
10   --------------------------------------------------------------------------------
11   -
12   -<%= _('Access the address below to view this comment:') %>
13   -<%= url_for @comment_url %>
14   -
15   -<%= _("Greetings,") %>
16   -
17   ---
18   -<%= _('%s team.') % @environment %>
19   -<%= url_for @url %>
app/views/comment_notifier/mail_to_followers.html.erb 0 → 100644
... ... @@ -0,0 +1,22 @@
  1 +<%= _('Hi!') %>
  2 +
  3 +<%= word_wrap(_('%{sender} (%{sender_link}) commented on the content "%{article_title}".') % { :sender => @sender, :sender_link => url_for(@sender_link), :article_title => @article_title }) %>
  4 +
  5 +<%= word_wrap(_('Title: %s') % @comment_title) if @comment_title %>
  6 +
  7 +<%= _("Comment:") %>
  8 +-------------------------------------------------------------------------------
  9 +<%= word_wrap(@comment_body) %>
  10 +-------------------------------------------------------------------------------
  11 +
  12 +<%= _('Click on the address below to view this comment:') %>
  13 +<%= url_for @comment_url %>
  14 +
  15 +<%= _('Click on the address below to cancel the notification of new comments:') %>
  16 +<%= url_for @unsubscribe_url %>
  17 +
  18 +<%= _("Greetings,") %>
  19 +
  20 +--
  21 +<%= _('%s team.') % @environment %>
  22 +<%= url_for @url %>
... ...
app/views/comment_notifier/notification.text.erb 0 → 100644
... ... @@ -0,0 +1,19 @@
  1 +<%= _('Hi, %{recipient}!') % { :recipient => @recipient } %>
  2 +
  3 +<%= word_wrap(_('%{sender} (%{sender_link}) created a new comment on your article "%{article_title}".') % { :sender => @sender, :sender_link => url_for(@sender_link), :article_title => @article_title }) %>
  4 +
  5 +<%= word_wrap(_('Title: %s') % @comment_title) %>
  6 +
  7 +<%= _("Comment:") %>
  8 +-------------------------------------------------------------------------------
  9 +<%= word_wrap(@comment_body) %>
  10 +-------------------------------------------------------------------------------
  11 +
  12 +<%= _('Access the address below to view this comment:') %>
  13 +<%= url_for @comment_url %>
  14 +
  15 +<%= _("Greetings,") %>
  16 +
  17 +--
  18 +<%= _('%s team.') % @environment %>
  19 +<%= url_for @url %>
... ...