public function EasyEmailController::previewType in Easy Email 8
Same name and namespace in other branches
- 2.0.x src/Controller/EasyEmailController.php \Drupal\easy_email\Controller\EasyEmailController::previewType()
1 string reference to 'EasyEmailController::previewType'
File
- src/
Controller/ EasyEmailController.php, line 74
Class
- EasyEmailController
- Class EasyEmailController.
Namespace
Drupal\easy_email\ControllerCode
public function previewType(EasyEmailTypeInterface $easy_email_type) {
$store = \Drupal::service('tempstore.private')
->get('easy_email_type_preview');
$uuid = $this->requestStack
->getCurrentRequest()
->get('uuid');
if (!empty($uuid) && ($preview = $store
->get($uuid))) {
$easy_email = $preview
->getFormObject()
->getEntity();
if (!empty($easy_email)) {
return $this
->preview($easy_email);
}
}
throw new AccessDeniedHttpException();
}