Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEATURE: Make FormValues directly available in EmailFinisher template #122

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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