Skip to content

Commit

Permalink
Merge pull request #29 from TheLalaMan/feature/make-referrer-availabl…
Browse files Browse the repository at this point in the history
…e-in-email-template

FEATURE: Make the referrer of the form available in Fluid template
  • Loading branch information
kdambekalns committed Dec 21, 2016
2 parents cd5a8ff + dd6687e commit fe07c50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Classes/Finishers/EmailFinisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
* - partialRootPath: root path for the partials
* - variables: associative array of variables which are available inside the Fluid template
*
* - referrer: The referrer of the form is available in the Fluid template
*
* The following options control the mail sending. In all of them, placeholders in the form
* of {...} are replaced with the corresponding form value; i.e. {email} as recipientAddress
* makes the recipient address configurable.
Expand Down Expand Up @@ -66,6 +68,8 @@ protected function executeInternal()
$formRuntime = $this->finisherContext->getFormRuntime();
$standaloneView = $this->initializeStandaloneView();
$standaloneView->assign('form', $formRuntime);
$referrer = $formRuntime->getRequest()->getHttpRequest()->getUri();
$standaloneView->assign('referrer', $referrer);
$message = $standaloneView->render();

$subject = $this->parseOption('subject');
Expand Down

0 comments on commit fe07c50

Please sign in to comment.