DataObjects/core.sql
[Pman.Core] / NotifySend.php
index ab93b6b..f924a36 100644 (file)
@@ -210,14 +210,19 @@ class Pman_Core_NotifySend extends Pman
                      "Notification event cleared (not required any more)" 
                     ."\n");
         }
-     
-        if (empty($p) && !empty($email['rcpts'])) {
+        if (is_a($email, 'PEAR_Error')) {
+            $email =array(
+                'error' => $email->toString()
+            );
+        }
+        
+        if (empty($p) && !empty($email['recipients'])) {
             // make a fake person..
             $p = (object) array(
-                'email' => $email['rcpts']
+                'email' => $email['recipients']
             );
         }
-        
+         
         if ($email === false || isset($email['error']) || empty($p)) {
             // object returned 'false' - it does not know how to send it..
             $ev = $this->addEvent('NOTIFY', $w, isset($email['error'])  ?
@@ -264,8 +269,8 @@ class Pman_Core_NotifySend extends Pman
         }
         
             // since some of them have spaces?!?!
-            $p->email = trim($p->email);
-        }
+        $p->email = trim($p->email);
+      
         
         require_once 'Validate.php';
         if (!Validate::email($p->email, true)) {