Download & Extend

Email admin when reports submitted

Project:abuse
Version:5.x-1.0-beta
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active

Issue Summary

Unless I'm doing something wrong, this module doesn't e-mail the site admin when somebody clicks "Flag as Offensive." We needed that feature so that our admin team could quickly take action. Below is my solution, in case it helps somebody else.

To the author, please consider adding something like the following at the end of abuse_report_form_submit(), just before drupal_goto...

<?php

  drupal_mail
('abuse_flagged',
             
variable_get('site_mail', ''),
             
t('Abuse was reported by !person (!mail)',array('!person'=>$user->name,'!mail'=>$user->mail)),
             
t("!username (!mail) has just reported abuse on a !thing at !url. Please !review.",
                    array(
'!username'=>$user->name,
                               
'!mail'=>$user->mail,
                               
'!thing'=>$object->type,
                               
'!title'=>$object->title,
                               
'!url'=>$object->link,
                               
'!review'=>l(t('review this'),url('admin/content/abuse',NULL,NULL,TRUE)))),
             
variable_get('site_mail', ''),
              array(
'MIME-Version'=>'1.0',
                  
'Content_Transfer-Encoding'=>'8bit',
                     
'Content-Type'=>'text/html; charsert=\'utf-8\';'));
?>

Comments

#1

I really didn't know that. And am looking exactly for something like that.
Is this code reliable enough to be put into a semi live project?

#2

I am now using Flags with Actions to achieve this.
Flags seems to be much more versatile...

nobody click here