Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Preview.php
Go to the documentation of this file.
1 <?php
8 
10 {
16  public function execute()
17  {
18  try {
19  $this->_view->loadLayout();
20  $this->_view->getPage()->getConfig()->getTitle()->prepend(__('Email Preview'));
21  $this->_view->renderLayout();
22  $this->getResponse()->setHeader('Content-Security-Policy', "script-src 'none'");
23  } catch (\Exception $e) {
24  $this->messageManager->addErrorMessage(
25  __('An error occurred. The email template can not be opened for preview.')
26  );
27  $this->_redirect('adminhtml/*/');
28  }
29  }
30 }
__()
Definition: __.php:13