NotifySend.php
[Pman.Core] / NotifySend.php
index ea30bd9..033d453 100644 (file)
@@ -95,7 +95,7 @@ class Pman_Core_NotifySend extends Pman
         $force = empty($opts['force']) ? 0 : 1;
         
         $w = DB_DataObject::factory($this->table);
-        
+
         if (!$w->get($id)) {
             $this->errorHandler("invalid id\n");
         }
@@ -357,7 +357,6 @@ class Pman_Core_NotifySend extends Pman
         require_once 'Mail.php';
         
         $core_domain = DB_DataObject::factory('core_domain');
-        print_R($core_domain);exit;
         if(!$core_domain->get('domain', $dom)){
             $core_domain = DB_DataObject::factory('core_domain');
             $core_domain->setFrom(array(
@@ -461,6 +460,10 @@ class Pman_Core_NotifySend extends Pman
                 
                 $ev->writeEventLog($this->debug_str);
                 
+                if(strtotime($w->act_when) > strtotime("NOW")){
+                    $w->act_when = date('Y-m-d H:i:s');
+                }
+                
                 $w->sent = date('Y-m-d H:i:s');
                 $w->msgid = $email['headers']['Message-Id'];
                 $w->event_id = $ev->id; // sent ok.. - no need to record it..
@@ -489,7 +492,7 @@ class Pman_Core_NotifySend extends Pman
                 }
                 
                 
-                $this->errorHandler(date('Y-m-d h:i:s') . " - SENT {$w->id} - {$w->to_email} \n");
+                $this->errorHandler(date('Y-m-d h:i:s') . " - SENT {$w->id} - {$w->to_email} \n", true);
             }
             // what type of error..
             $code = empty($res->userinfo['smtpcode']) ? -1 : $res->userinfo['smtpcode'];