connectToImap()) { $this->templateName = 'imaperror'; return; } $params = $this->getUriParams(); $this->uid = $params['uid']; $this->folder = $params['folder']; $this->content['uid'] = $this->uid; } protected function generateContent(): void { // $messageStructure = imap_fetchstructure($this->mbox, $this->uid); $this->fetchEmailHeader($this->content); $this->fetchEmailBody($messageStructure, $this->content, 'INBOX', FT_PEEK); $this->renderAttachments($messageStructure); } protected function renderAttachments($messageStructure): void { $attachments = $this->getAttachments($messageStructure); $contentArray = []; foreach ($attachments as $attachment) { $contentArray[] = $attachment['filename']; } $this->content['attachments'] = implode('
', $contentArray); } }