Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Matt <lukas@zauberstuhl.de>2013-09-12 16:46:59 +0400
committerLukas Matt <lukas@zauberstuhl.de>2014-01-15 00:00:55 +0400
commit5c9a3aaf3ea4fc568c572f9de67d94ac64fdafff (patch)
tree487d48507985f26330b839e5ef0fb24f4905531e /app/mailers
parent1a8541ff1ab31203d68030fe9dcdea14d848e47a (diff)
Added post report feature
You can report a single post by clicking the correct icon in the controler section Workflow: * Report a post as offensive * Trigger alerts to every pod-admin * Pod-admin can review it in the admin interface * Delete the post or mark it as reviewed
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/post_report_mailer.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/mailers/post_report_mailer.rb b/app/mailers/post_report_mailer.rb
new file mode 100644
index 000000000..46b6737cc
--- /dev/null
+++ b/app/mailers/post_report_mailer.rb
@@ -0,0 +1,18 @@
+class PostReportMailer < ActionMailer::Base
+ default :from => AppConfig.mail.sender_address
+
+ def new_report
+ Role.admins.each do |role|
+ email = User.find_by_id(role.person_id).email
+ format(email).deliver
+ end
+ end
+
+ private
+ def format(email)
+ mail(to: email, subject: I18n.t('notifier.post_report_email.subject')) do |format|
+ format.text { render 'post_report/post_report_email' }
+ format.html { render 'post_report/post_report_email' }
+ end
+ end
+end