/** * Save the email in the paper email log. */ function log() { import('paper.log.PaperEmailLogEntry'); import('paper.log.PaperLog'); $entry = new PaperEmailLogEntry(); // Log data $entry->setEventType($this->eventType); $entry->setAssocType($this->assocType); $entry->setAssocId($this->assocId); // Email data $entry->setSubject($this->getSubject()); $entry->setBody($this->getBody()); $entry->setFrom($this->getFromString()); $entry->setRecipients($this->getRecipientString()); $entry->setCcs($this->getCcString()); $entry->setBccs($this->getBccString()); // Add log entry $paper =& $this->paper; PaperLog::logEmailEntry($paper->getId(), $entry); }
/** * Internal function to return an PaperEmailLogEntry object from a row. * @param $row array * @return PaperEmailLogEntry */ function &_returnLogEntryFromRow(&$row) { $entry = new PaperEmailLogEntry(); $entry->setLogId($row['log_id']); $entry->setPaperId($row['paper_id']); $entry->setSenderId($row['sender_id']); $entry->setDateSent($this->datetimeFromDB($row['date_sent'])); $entry->setIPAddress($row['ip_address']); $entry->setEventType($row['event_type']); $entry->setAssocType($row['assoc_type']); $entry->setAssocId($row['assoc_id']); $entry->setFrom($row['from_address']); $entry->setRecipients($row['recipients']); $entry->setCcs($row['cc_recipients']); $entry->setBccs($row['bcc_recipients']); $entry->setSubject($row['subject']); $entry->setBody($row['body']); HookRegistry::call('PaperEmailLogDAO::_returnLogEntryFromRow', array(&$entry, &$row)); return $entry; }