summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/models/comment.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/comment.rb b/app/models/comment.rb
index ac60e497c..d108cb103 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -29,8 +29,9 @@ class Comment < ActiveRecord::Base
private
def send_notification
- if commented.is_a?(News) && Setting.notified_events.include?('news_comment_added')
- Mailer.news_comment_added(self).deliver
+ mailer_method = "#{commented.class.name.underscore}_comment_added"
+ if Setting.notified_events.include?(mailer_method)
+ Mailer.send(mailer_method, self).deliver
end
end
end