1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | <?php use In2code\Powermail\Domain\Repository\MailRepository; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager; /** * The PersistenceManager call is necessary when powermail redirects * to a "thank you" page. Otherwise it's persisted automatically. * * This is with TYPO3v11 and powermail 10.9.2 */ class ExampleFinisher extends AbstractFinisher { public function submitFinisher(): void { $apiData = ['foo' => 'bar']; $logAnswer = $this->getMail()->getAnswersByFieldMarker()['postdatalog']; $logAnswer->setValue($apiData); $mailRepository = GeneralUtility::makeInstance(MailRepository::class); $mailRepository->update($this->getMail()); $persistenceManager = GeneralUtility::makeInstance(PersistenceManager::class); $persistenceManager->persistAll(); } } |