<?php
class EmailReport_Report extends XenForo_Model_Report
{
public function reportContent($contentType, array $content, $message, array $viewingUser = null)
{
$reportId = parent::reportContent($contentType, $content, $message, $viewingUser);
if ($reportId == 0)
{
return false;
}
$users = $this->fetchAllKeyed('SELECT * FROM xf_user WHERE is_admin = 1', 'user_id');
$report = $this->getReportById($reportId);
$reportComments = $this->getReportComments($reportId);
foreach ($users as $user)
{
$params = array(
'user' => $user,
'report' => $report,
'reportComments' => $reportComments
);
$mail = new XenForo_Mail('new_item_reported', $params, $user['language_id']);
$mail->send($user['email'], $user['username']);
}
}
}