From 5a92f3aecd29eec91d076ab47c230898b1bc437b Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Thu, 28 Jan 2016 15:47:29 +0800 Subject: [PATCH] NotifySend.php --- NotifySend.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/NotifySend.php b/NotifySend.php index ace03b6b..9e986bc7 100644 --- a/NotifySend.php +++ b/NotifySend.php @@ -211,9 +211,14 @@ class Pman_Core_NotifySend extends Pman ."\n"); } - + if (empty($p) && !empty($email['rcpts'])) { + // make a fake person.. + $p = (object) array( + 'email' => $email['rcpts'] + ); + } - if ($email === false || isset($email['error'])) { + 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']) ? $email['error'] : "INTERNAL ERROR - We can not handle " . $w->ontable); @@ -242,6 +247,11 @@ class Pman_Core_NotifySend extends Pman $email['headers']['Message-Id'] = "<{$this->table}-{$id}@{$HOST}>"; } + + + if (empty($p)) { + + //$p->email = 'alan@akbkhome.com'; //for testing.. //print_r($email);exit; // should we fetch the watch that caused it.. - which should contain the method to call.. @@ -253,7 +263,7 @@ class Pman_Core_NotifySend extends Pman if (!empty($opts['send-to'])) { $p->email = $opts['send-to']; } - if ($p) { + // since some of them have spaces?!?! $p->email = trim($p->email); } -- 2.39.2