Skip to content

Commit

Permalink
Merge pull request #122 from neos/feature/121-make-EmailFinisher-form…
Browse files Browse the repository at this point in the history
…Values-directly-accessible

FEATURE: Make FormValues directly available in EmailFinisher template
  • Loading branch information
daniellienert committed Aug 19, 2020
2 parents 473c9fb + 67bd922 commit 3ba1c8d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Classes/Finishers/EmailFinisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Neos\Form\Core\Model\AbstractFinisher;
use Neos\Form\Exception\FinisherException;
use Neos\SwiftMailer\Message as SwiftMailerMessage;
use Neos\Utility\Arrays;
use Neos\Utility\ObjectAccess;
use Neos\Flow\Annotations as Flow;

Expand Down Expand Up @@ -248,11 +249,13 @@ protected function initializeStandaloneView(string $format = ''): StandaloneView
$standaloneView->setLayoutRootPath($this->options['layoutRootPath']);
}

$standaloneView->assign('formValues', $this->finisherContext->getFormValues());

$variables = $this->finisherContext->getFormValues();
// Backwards compatibility, see https://github.com/neos/form/issues/121
$variables['formValues'] = $this->finisherContext->getFormValues();
if (isset($this->options['variables'])) {
$standaloneView->assignMultiple($this->options['variables']);
$variables = Arrays::arrayMergeRecursiveOverrule($variables, $this->options['variables']);
}
$standaloneView->assignMultiple($variables);
return $standaloneView;
}

Expand Down

0 comments on commit 3ba1c8d

Please sign in to comment.