/** * Save the email in the article email log. */ function log() { import('classes.article.log.ArticleEmailLogEntry'); import('classes.article.log.ArticleLog'); $entry = new ArticleEmailLogEntry(); $article =& $this->article; // 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(false)); $entry->setRecipients($this->getRecipientString()); $entry->setCcs($this->getCcString()); $entry->setBccs($this->getBccString()); // Add log entry $logEntryId = ArticleLog::logEmailEntry($article->getId(), $entry); // Add attachments import('classes.file.ArticleFileManager'); $articleFileManager = new ArticleFileManager($article->getId()); foreach ($this->getAttachmentFiles() as $attachment) { $articleFileManager->temporaryFileToArticleFile($attachment, ARTICLE_FILE_ATTACHMENT, $logEntryId); } }