logFactory = $logFactory; } /** * Get email content * * @return string */ public function getContent() { $content = htmlspecialchars_decode($this->getLog()->getEmailContent()); $content = preg_replace('#(.*?)#is', '', $content); return $content; } /** * Load email log by id * * @return mixed */ public function getLog() { $logId = $this->getRequest()->getParam('id'); $log = $this->logFactory->create()->load($logId); if ($log) { return $log; } return false; } /** * @return AbstractBlock */ protected function _prepareLayout() { if ($this->getToolbar()) { $this->getToolbar()->addChild( 'back_button', 'Magento\Backend\Block\Widget\Button', [ 'label' => __('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/log') . '\')', 'class' => 'back' ] ); } return parent::_prepareLayout(); } }