/**
  * Returns the hmac for the given registration in order to cancel the registration
  *
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration Registration
  *
  * @return array
  */
 public function render($registration)
 {
     $result = '';
     if ($registration) {
         $result = $this->hashService->generateHmac('reg-' . $registration->getUid());
     }
     return $result;
 }
 /**
  * Returns the rendered HTML for the given template
  *
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Event $event Event
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration Registration
  * @param string $template Template
  * @param array $settings Settings
  *
  * @return string
  */
 protected function getNotificationBody($event, $registration, $template, $settings)
 {
     /** @var \TYPO3\CMS\Fluid\View\StandaloneView $emailView */
     $emailView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $emailView->setFormat('html');
     $layoutRootPaths = $this->fluidStandaloneService->getTemplateFolders('layout');
     $partialRootPaths = $this->fluidStandaloneService->getTemplateFolders('partial');
     if (TYPO3_MODE === 'BE' && $registration->getLanguage() !== '') {
         // Temporary set Language of current BE user to given language
         $GLOBALS['BE_USER']->uc['lang'] = $registration->getLanguage();
         $emailView->getRequest()->setControllerExtensionName('SfEventMgt');
     }
     $emailView->setLayoutRootPaths($layoutRootPaths);
     $emailView->setPartialRootPaths($partialRootPaths);
     $emailView->setTemplatePathAndFilename($this->fluidStandaloneService->getTemplatePath($template));
     $emailView->assignMultiple(['event' => $event, 'registration' => $registration, 'settings' => $settings, 'hmac' => $this->hashService->generateHmac('reg-' . $registration->getUid()), 'reghmac' => $this->hashService->appendHmac((string) $registration->getUid())]);
     $emailBody = $emailView->render();
     return $emailBody;
 }
 /**
  * Returns the payment Uri for the given action and registration
  *
  * @param string $action
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration
  * @return string
  * @throws \TYPO3\CMS\Extbase\Security\Exception\InvalidArgumentForHashGenerationException
  */
 protected function getPaymentUriForAction($action, $registration)
 {
     $this->uriBuilder->setCreateAbsoluteUri(true)->setUseCacheHash(false);
     return $this->uriBuilder->uriFor($action, ['registration' => $registration, 'hmac' => $this->hashService->generateHmac($action . 'Action-' . $registration->getUid())], 'Payment', 'sfeventmgt', 'Pipayment');
 }
 /**
  * Returns the rendered HTML for the given template
  *
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Event $event Event
  * @param \DERHANSEN\SfEventMgt\Domain\Model\Registration $registration Registration
  * @param string $template Template
  * @param array $settings Settings
  *
  * @return string
  */
 protected function getNotificationBody($event, $registration, $template, $settings)
 {
     /** @var \TYPO3\CMS\Fluid\View\StandaloneView $emailView */
     $emailView = $this->objectManager->get('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
     $emailView->setFormat('html');
     $extbaseFrameworkConfiguration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FULL_TYPOSCRIPT);
     $templateRootPath = GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['plugin.']['tx_sfeventmgt.']['view.']['templateRootPath']);
     $layoutRootPath = GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['plugin.']['tx_sfeventmgt.']['view.']['layoutRootPath']);
     $partialRootPath = GeneralUtility::getFileAbsFileName($extbaseFrameworkConfiguration['plugin.']['tx_sfeventmgt.']['view.']['partialRootPath']);
     $emailView->setLayoutRootPath($layoutRootPath);
     $emailView->setPartialRootPath($partialRootPath);
     $emailView->setTemplatePathAndFilename($templateRootPath . $template);
     $emailView->assignMultiple(array('event' => $event, 'registration' => $registration, 'settings' => $settings, 'hmac' => $this->hashService->generateHmac('reg-' . $registration->getUid()), 'reghmac' => $this->hashService->appendHmac((string) $registration->getUid())));
     $emailBody = $emailView->render();
     return $emailBody;
 }