NotifySend.php
[Pman.Core] / NotifySend.php
index 15308ca..af7c4ef 100644 (file)
@@ -415,6 +415,7 @@ class Pman_Core_NotifySend extends Pman
                             $this->errorHandler(date('Y-m-d h:i:s ') . " Too many emails sent by {$dom}");
                         }
                         
+                        // that make's this test obsolete...
                         /*
                         
                         $core_notify = DB_DataObject::factory($this->table);
@@ -453,10 +454,16 @@ class Pman_Core_NotifySend extends Pman
             if ($res === true) {
                 // success....
                 
-                $ev = $this->addEvent('NOTIFYSENT', $w, "{$w->to_email} - {$email['headers']['Subject']}");
+                $successEventName = (empty($email['successEventName'])) ? 'NOTIFYSENT' : $email['successEventName'];
+                
+                $ev = $this->addEvent($successEventName, $w, "{$w->to_email} - {$email['headers']['Subject']}");
                 
                 $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..