--- phpids.module.orig	2008-03-24 18:29:40.000000000 +0100
+++ phpids.module	2008-03-24 18:38:40.000000000 +0100
@@ -138,10 +138,8 @@
         watchdog('phpids',wordwrap($message,'100',' ',TRUE));
 
         // send out mail if needed
-        // TODO: more info in mail
         if ($action == 1) {
-          $body = 'Check your logs to see a full detail of the report.';
-          drupal_mail('',$mail_sent,'PHPIDS detected an attack with impact '.$severity,$body);
+          drupal_mail('phpids','warning',$mail_sent,user_preferred_language($account),array('severity' => $severity));
         }
         // Warning : redirect the user to a warning page so nothing can happen to the system
         if ($action == 2) {
@@ -154,6 +152,18 @@
   }
 }
 
+/**
+ * Mail function
+ * @todo more info in mail  
+ */
+function phpids_mail($key,&$message,$params) {
+  $language = $message['language'];
+  $message['subject'] = t('Notification from !site', $variables, $language->language);
+  $body = 'Check your logs to see a full detail of the report.';
+  $message['subject'] = t('PHPIDS detected an attack with impact !severity', array('!severity' => $params['severity']));
+  $message['body'] = t($body);
+}
+
 /*
  * Callback function to configure PHPIDS
  */
