// let's work out the last notification sent to this user..
$l = DB_DataObject::factory($this->table);
- $l->setFrom( array(
+
+ $lar = array(
'ontable' => $w->ontable,
'onid' => $w->onid,
- 'person_id' => $w->person_id,
- ));
+ );
+ $lar[strtolower($w->person_table).'_id'] = $w->{strtolower($w->person_table).'_id'};
+
+ $l->setFrom( $lar );
$l->whereAdd('id != '. $w->id);
$l->orderBy('sent DESC');
$l->limit(1);
// since some of them have spaces?!?!
$p->email = trim($p->email);
-
require_once 'Validate.php';
if (!Validate::email($p->email, true)) {
$ev = $this->addEvent('NOTIFY', $w, "INVALID ADDRESS: " . $p->email);