You are here

public function EasyEmailForm::preview in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x src/Form/EasyEmailForm.php \Drupal\easy_email\Form\EasyEmailForm::preview()

Form submit handler for previewing an easy email type template.

Parameters

array $form:

\Drupal\Core\Form\FormStateInterface $form_state:

Return value

array

Throws

\Drupal\Core\TempStore\TempStoreException

File

src/Form/EasyEmailForm.php, line 373

Class

EasyEmailForm
Form controller for Email edit forms.

Namespace

Drupal\easy_email\Form

Code

public function preview(array $form, FormStateInterface $form_state) {
  $this
    ->setValuesFromFormState($form, $form_state);
  $store = $this->tempStoreFactory
    ->get('easy_email_type_preview');
  $this->entity->in_preview = TRUE;
  $store
    ->set($this->entity
    ->uuid(), $form_state);
  $form_state
    ->setRebuild(TRUE);
  return $form;
}