about summary refs log tree commit diff
path: root/app/controllers/api
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-06-27 00:04:00 +0200
committerGitHub <noreply@github.com>2017-06-27 00:04:00 +0200
commit42b82206322c73c4a4d7ac29ca9a781ab11e7b1a (patch)
treed27e31942c373cf8c919b512b0d6e45c0809468f /app/controllers/api
parenta91d968cab5120ca389fcc7d6788cafca85e69e7 (diff)
Fix #1624 - Send e-mail notifications to admins about new reports (#3949)
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v1/reports_controller.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/controllers/api/v1/reports_controller.rb b/app/controllers/api/v1/reports_controller.rb
index 71df76e92..8e7070d07 100644
--- a/app/controllers/api/v1/reports_controller.rb
+++ b/app/controllers/api/v1/reports_controller.rb
@@ -17,6 +17,9 @@ class Api::V1::ReportsController < Api::BaseController
       status_ids: reported_status_ids,
       comment: report_params[:comment]
     )
+
+    User.admins.includes(:account).each { |u| AdminMailer.new_report(u.account, @report).deliver_later }
+
     render :show
   end