public static function AddToQueue(EMail $oEMail, $oLog) { $oNew = MetaModel::NewObject(__CLASS__); if ($oLog) { $oNew->Set('event_id', $oLog->GetKey()); } $oNew->Set('to', $oEMail->GetRecipientTO(true)); $oNew->Set('subject', $oEMail->GetSubject()); // $oNew->Set('version', 1); // $sMessage = serialize($oEMail); $oNew->Set('version', 2); $sMessage = $oEMail->SerializeV2(); $oNew->Set('message', $sMessage); $oNew->DBInsert(); }