/** * Create FlexForm * * @param array $form * @param int $formUid Form that was created before * @return string */ protected function createFlexForm($form, $formUid) { $form['tx_powermail_thanks'] = $this->rewriteVariables($form['tx_powermail_thanks'], $form, true); $form['tx_powermail_mailsender'] = $this->rewriteVariables($form['tx_powermail_mailsender'], $form, true); $form['tx_powermail_mailreceiver'] = $this->rewriteVariables($form['tx_powermail_mailreceiver'], $form, true); $form['tx_powermail_recipient'] = $this->rewriteVariables($form['tx_powermail_recipient'], $form); $form['tx_powermail_subject_r'] = $this->rewriteVariables($form['tx_powermail_subject_r'], $form); $form['tx_powermail_subject_s'] = $this->rewriteVariables($form['tx_powermail_subject_s'], $form); if ($form['sys_language_uid'] > 0) { $formUid = (int) $this->localizationRelations['form'][$form['l18n_parent']]; } $standaloneView = TemplateUtility::getDefaultStandAloneView(); $standaloneView->getRequest()->setControllerName('Module'); $standaloneView->setTemplatePathAndFilename(TemplateUtility::getTemplatePath('Module/ConverterFlexForm.xml')); $standaloneView->assignMultiple(['formUid' => $formUid, 'form' => $form, 'configuration' => $this->configuration]); return $standaloneView->render(); }
/** * Create export file content * * @return string * @throws InvalidActionNameException * @throws InvalidControllerNameException */ protected function getFileContent() { $standaloneView = TemplateUtility::getDefaultStandAloneView(); $standaloneView->setTemplatePathAndFilename(TemplateUtility::getTemplatePath($this->getRelativeTemplatePathAndFileName())); $standaloneView->setLayoutRootPaths(TemplateUtility::getTemplateFolders('layout')); $standaloneView->setPartialRootPaths(TemplateUtility::getTemplateFolders('partial')); $standaloneView->assignMultiple(array('mails' => $this->getMails(), 'fieldUids' => $this->getFieldList())); return $standaloneView->render(); }
/** * Create Email Body * * @param array $email Array with all needed mail information * @return bool */ protected function createEmailBody($email) { $standaloneView = TemplateUtility::getDefaultStandAloneView(); $standaloneView->getRequest()->setControllerName('Form'); $standaloneView->setTemplatePathAndFilename(TemplateUtility::getTemplatePath($email['template'] . '.html')); $standaloneView->setLayoutRootPaths(TemplateUtility::getTemplateFolders('layout')); $standaloneView->setPartialRootPaths(TemplateUtility::getTemplateFolders('partial')); // variables $variablesWithMarkers = $this->mailRepository->getVariablesWithMarkersFromMail($this->mail); $standaloneView->assignMultiple($variablesWithMarkers); $standaloneView->assignMultiple($this->mailRepository->getLabelsWithMarkersFromMail($this->mail)); $standaloneView->assignMultiple(array('variablesWithMarkers' => ArrayUtility::htmlspecialcharsOnArray($variablesWithMarkers), 'powermail_all' => TemplateUtility::powermailAll($this->mail, 'mail', $this->settings, $this->type), 'powermail_rte' => $email['rteBody'], 'marketingInfos' => SessionUtility::getMarketingInfos(), 'mail' => $this->mail, 'email' => $email, 'settings' => $this->settings)); if (!empty($email['variables'])) { $standaloneView->assignMultiple($email['variables']); } $this->signalSlotDispatcher->dispatch(__CLASS__, __FUNCTION__ . 'BeforeRender', array($standaloneView, $email, $this->mail, $this->settings)); $body = $standaloneView->render(); $this->mail->setBody($body); return $body; }
/** * Create export file content * * @return string * @throws InvalidActionNameException * @throws InvalidControllerNameException */ protected function getFileContent() { $standaloneView = TemplateUtility::getDefaultStandAloneView(); $standaloneView->setTemplatePathAndFilename(TemplateUtility::getTemplatePath($this->getRelativeTemplatePathAndFileName())); $standaloneView->assignMultiple(['mails' => $this->getMails(), 'fieldUids' => $this->getFieldList()]); return $standaloneView->render(); }