$next_try_min = floor((time() - strtotime($last_event)) / 60) * 2;
}
$next_try = $next_try_min . ' MINUTES';
-
- $email = $this->makeEmail($o, $p, $last, $w);
+
+ // this may modify $p->email. (it will not update it though)
+ $email = $this->makeEmail($o, $p, $last, $w, $force);
if ($email === true) {
// older that 1 day.
$retry = 120;
}
-
+ $w->to_email = $p->email;
//$this->addEvent('NOTIFY', $w, 'GREYLISTED ' . $p->email . ' ' . $res->toString());
$w->act_when = date('Y-m-d H:i:s', strtotime('NOW + ' . $retry . ' MINUTES'));
$w->update($ww);
if ($res === true) {
// success....
- $ev = $this->addEvent('NOTIFY', $w, 'SUCCESS: ' .$email['headers']['Subject']);
+ $ev = $this->addEvent('NOTIFYSENT', $w, "{$w->to_email} - {$email['headers']['Subject']}");
}
**/
- function makeEmail($object, $rcpt, $last_sent_date, $notify)
+ function makeEmail($object, $rcpt, $last_sent_date, $notify, $force =false)
{
- return $object->toEmail($rcpt, $last_sent_date, $notify);
+ $m = 'notify'. $notify->evtype;
+ if (!empty($notify->evtype) && method_exists($object,'notify'. $notify->evtype)) {
+ $object->$m($rcpt, $last_sent_date, $notify, $force);
+ }
+
+
+ return $object->toEmail($rcpt, $last_sent_date, $notify, $force);
}
function debug($str)