function get($id,$opts=array())
{
-
+
//print_r($opts);
if (!empty($opts['DB_DataObject-debug'])) {
DB_DataObject::debugLevel($opts['DB_DataObject-debug']);
if (!$w->get($id)) {
$this->errorHandler("invalid id\n");
}
- if (!$force && strtotime($w->act_when) < strtotime($w->sent)) {
+
+ if (!$force && !empty($w->sent) && strtotime($w->act_when) < strtotime($w->sent)) {
$this->errorHandler("send repeat to early\n");
'onid' => $w->onid,
);
// only newer version of the database us this..
- $personid_col = strtolower($w->person_table).'_id';
- if (isset($w->{$personid_col})) {
- $lar[$personid_col] = $w->{$personid_col};
+ if (isset($w->person_table)) {
+ $personid_col = strtolower($w->person_table).'_id';
+ if (isset($w->{$personid_col})) {
+ $lar[$personid_col] = $w->{$personid_col};
+ }
}
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']) ?
+ $ev = $this->addEvent('NOTIFYFAIL', $w, isset($email['error']) ?
$email['error'] : "INTERNAL ERROR - We can not handle " . $w->ontable);
$ww = clone($w);
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
require_once 'Validate.php';
if (!Validate::email($p->email, true)) {
- $ev = $this->addEvent('NOTIFY', $w, "INVALID ADDRESS: " . $p->email);
+ $ev = $this->addEvent('NOTIFYFAIL', $w, "INVALID ADDRESS: " . $p->email);
$ww = clone($w);
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
$w->msgid = '';
$this->errorHandler(date('Y-m-d h:i:s') . " - MX LOOKUP FAILED\n");
}
- $ev = $this->addEvent('NOTIFY', $w, "BAD ADDRESS - BAD DOMAIN - ". $p->email );
+ $ev = $this->addEvent('NOTIFYFAIL', $w, "BAD ADDRESS - BAD DOMAIN - ". $p->email );
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
$w->msgid = '';
$w->event_id = $ev->id;
if (!$force && strtotime($w->act_start) < strtotime('NOW - 14 DAY')) {
- $ev = $this->addEvent('NOTIFY', $w, "BAD ADDRESS - GIVE UP - ". $p->email );
+ $ev = $this->addEvent('NOTIFYFAIL', $w, "BAD ADDRESS - GIVE UP - ". $p->email );
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') :$w->sent; // do not update if sent.....
$w->msgid = '';
$w->event_id = $ev->id;
$errmsg= $res->userinfo['smtpcode'] . ':' . $res->userinfo['smtptext'];
}
- $ev = $this->addEvent('NOTIFY', $w, ($fail ? "FAILED - " : "RETRY TIME EXCEEDED - ") .
+ $ev = $this->addEvent('NOTIFYFAIL', $w, ($fail ? "FAILED - " : "RETRY TIME EXCEEDED - ") .
$errmsg);
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
$w->msgid = '';
// handle no host availalbe forever...
if (strtotime($w->act_start) < strtotime('NOW - 3 DAYS')) {
- $ev = $this->addEvent('NOTIFY', $w, "RETRY TIME EXCEEDED - ". $p->email);
+ $ev = $this->addEvent('NOTIFYFAIL', $w, "RETRY TIME EXCEEDED - ". $p->email);
$w->sent = (!$w->sent || $w->sent == '0000-00-00 00:00:00') ? $w->sqlValue('NOW()') : $w->sent; // do not update if sent.....
$w->msgid = '';
$w->event_id = $ev->id;
{
$this->debug_str .= strlen($this->debug_str) ? "\n" : '';
$this->debug_str .= $message;
+ //echo $message ."\n";
}
function errorHandler($msg, $success = false)