$o = $w->object();
+
+ if ($o === false) {
+
+ $ev = $this->addEvent('NOTIFY', $w,
+ "Notification event cleared (underlying object does not exist)" );;
+ $ww = clone($w);
+ $w->sent = date('Y-m-d H:i:s');
+ $w->msgid = '';
+ $w->event_id = $ev->id;
+ $w->update($ww);
+ die(date('Y-m-d h:i:s ') .
+ "Notification event cleared (underlying object does not exist)"
+ ."\n");
+ }
+
+
+
$p = $w->person();
if (isset($p->active) && empty($p->active)) {
//print_r($email);exit;
// should we fetch the watch that caused it.. - which should contain the method to call..
// --send-to=test@xxx.com
- if (!empty($opts['send-to'])) {
- $p->email = $opts['send-to'];
- }
+
if (!empty($email['send-to'])) {
$p->email = $email['send-to'];
}
- print_r($p);
+ if (!empty($opts['send-to'])) {
+ $p->email = $opts['send-to'];
+ }
+
+ //print_r($p);
require_once 'Validate.php';
if (!Validate::email($p->email, true)) {
$ev = $this->addEvent('NOTIFY', $w, "INVALID ADDRESS: " . $p->email);
$w->msgid = '';
$w->event_id = $ev->id;
$w->update($ww);
- die(date('Y-m-d h:i:s ') . "INVALID ADDRESS: " . $p->email. "111\n");
+ die(date('Y-m-d h:i:s ') . "INVALID ADDRESS: " . $p->email. "\n");
}
function makeEmail($object, $rcpt, $last_sent_date, $notify, $force =false)
{
$m = 'notify'. $notify->evtype;
- var_dump($m);
+ //var_dump($m);
if (!empty($notify->evtype) && method_exists($object,$m)) {
return $object->$m($rcpt, $last_sent_date, $notify, $force);
}
-
+ if (!method_exists($object, 'toEmail')) {
+ //var_Dump($object);
+ //exit;
+ }
return $object->toEmail($rcpt, $last_sent_date, $notify, $force);
}