evtype and handle no matching evtype call
[Pman.Core] / NotifySend.php
index 0404f6c..132930b 100644 (file)
@@ -257,6 +257,7 @@ class Pman_Core_NotifySend extends Pman
                     ."\n");
         }
         
+         
         
         if (isset($email['later'])) {
             $old = clone($w);
@@ -654,7 +655,8 @@ class Pman_Core_NotifySend extends Pman
             echo "calling :" . get_class($object) . '::' .$m . "\n";
             return $object->$m($rcpt, $last_sent_date, $notify, $force);
         }
-                
+        // fallback if evtype is empty..
+        
         if (method_exists($object, 'toMailerData')) {
             return $object->toMailerData(array(
                 'rcpts'=>$rcpt,
@@ -663,8 +665,12 @@ class Pman_Core_NotifySend extends Pman
             //var_Dump($object);
             //exit;
         }
+        if (method_exists($object, 'toEmail')) {
+            return $object->toEmail($rcpt, $last_sent_date, $notify, $force);
+        }
+        // no way to send this.. - this needs to handle core_notify how we have used it for the approval stuff..
         
-        return $object->toEmail($rcpt, $last_sent_date, $notify, $force);
+        return false;
     }
     
     function debug($str)
@@ -710,6 +716,10 @@ class Pman_Core_NotifySend extends Pman
         if (empty($ff->Core_Notify['servers'])) {
             return;
         }
+        // some classes dont support server routing
+        if (!property_exists($w, 'server_id')) {
+            return;
+        }
         // next server..
         $w->server_id = ($w->server_id + 1) % count(array_keys($ff->Core_Notify['servers']));
          
@@ -718,6 +728,14 @@ class Pman_Core_NotifySend extends Pman
      function initHelo()
     {
         $ff = HTML_FlexyFramework::get();
+        
+        if (isset($ff->Core_Notify['servers-non-pool'])  &&
+            isset($ff->Core_Notify['servers-non-pool'][gethostname()]) &&
+            isset($ff->Core_Notify['servers-non-pool'][gethostname()]['helo']) ) {
+            $ff->Mail['helo'] = $ff->Core_Notify['servers-non-pool'][gethostname()]['helo'];
+            return;
+        }
+        
         if (empty($ff->Core_Notify['servers'])) {
             return;
         }