diff options
author | Steffen van Bergerem <svbergerem@online.de> | 2016-02-07 18:21:36 +0300 |
---|---|---|
committer | Steffen van Bergerem <svbergerem@online.de> | 2016-02-07 19:58:03 +0300 |
commit | 482cbe7fcc649d8fc4fad10ded72984642b67914 (patch) | |
tree | 200f1d1c814ce0efd6665e71667fb43cdb376080 /app/mailers | |
parent | c867fb6e26d28a59d665d861c355695c063da7ca (diff) |
Add reason for post report to email sent to admins
Diffstat (limited to 'app/mailers')
-rw-r--r-- | app/mailers/report_mailer.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/app/mailers/report_mailer.rb b/app/mailers/report_mailer.rb index a89468b8b..dbb3c2f12 100644 --- a/app/mailers/report_mailer.rb +++ b/app/mailers/report_mailer.rb @@ -1,15 +1,17 @@ class ReportMailer < ActionMailer::Base default from: AppConfig.mail.sender_address - def self.new_report(type, id) - Role.moderators.map {|role| super(type, id, role) } + def self.new_report(report_id) + report = Report.find_by_id(report_id) + Role.moderators.map {|role| super(report.item_type, report.item_id, report.text, role) } end - def new_report(type, id, role) + def new_report(type, id, reason, role) resource = { - url: report_index_url, - type: I18n.t("notifier.report_email.type.#{type.downcase}"), - id: id + url: report_index_url, + type: I18n.t("notifier.report_email.type.#{type.downcase}"), + id: id, + reason: reason } person = Person.find(role.person_id) return unless person.local? |