From d51c93b43e4b24b56e5c225154be4a60fcb418c6 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Mon, 01 Jun 2009 03:21:14 -0400
Subject: [PATCH] - get rid of some hardcoded action names and move decission about output compression to the user

---
 program/steps/mail/func.inc |   27 +++++++++++++--------------
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 5e9bc8a..25f1d81 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1293,8 +1293,7 @@
   $headers = $message->headers();
 
   // send thru SMTP server using custom SMTP library
-  if ($CONFIG['smtp_server'])
-    {
+  if ($CONFIG['smtp_server']) {
     // generate list of recipients
     $a_recipients = array($mailto);
   
@@ -1317,11 +1316,9 @@
     if (!$sent)
       raise_error(array('code' => 800, 'type' => 'smtp', 'line' => __LINE__, 'file' => __FILE__,
                         'message' => "SMTP error: ".join("\n", $smtp_response)), TRUE, FALSE);
-    }
-  
+  }
   // send mail using PHP's mail() function
-  else
-    {
+  else {
     // unset some headers because they will be added by the mail() function
     $headers_enc = $message->headers($headers);
     $headers_php = $message->_headers;
@@ -1342,19 +1339,21 @@
       $sent = mail($headers_enc['To'], $headers_enc['Subject'], $msg_body, $header_str);
     else
       $sent = mail($headers_enc['To'], $headers_enc['Subject'], $msg_body, $header_str, "-f$from");
-    }
+  }
   
-  if ($sent)
-  {
+  if ($sent) {
+    $RCMAIL->plugins->exec_hook('message_sent', array('headers' => $headers, 'body' => $msg_body));
+    
     // remove MDN headers after sending
     unset($headers['Return-Receipt-To'], $headers['Disposition-Notification-To']);
     
-    if ($CONFIG['smtp_log'])
+    if ($CONFIG['smtp_log']) {
       write_log('sendmail', sprintf("User %s [%s]; Message for %s; %s",
-		$RCMAIL->user->get_username(),
-		$_SERVER['REMOTE_ADDR'],
-		$mailto,
-		!empty($smtp_response) ? join('; ', $smtp_response) : ''));
+        $RCMAIL->user->get_username(),
+        $_SERVER['REMOTE_ADDR'],
+        $mailto,
+        !empty($smtp_response) ? join('; ', $smtp_response) : ''));
+    }
   }
   
   $message->_headers = array();

--
Gitblit v1.9.1