- 🇺🇸United States nathan573 New York
Thanks for this patch! I've implemented with my custom module and it works!
Here is my code if it saves anybody some time implementing this. I'm a bit new to Drupal 9 and subscribers so AMATEUR CODE ALERT!
custom_module/custom_module.services.yml
services: custom_module.pardot_submission_event_subscribe: class: Drupal\custom_module\EventSubscribe\PardotSubmissionEventSubscriber tags: - { name: 'event_subscriber' }
custom_module/src/EventSubscribe/PardotSubmissionEventSubscriber.php
<?php namespace Drupal\custom_module\EventSubscribe; use Drupal\webform_pardot\Event\PardotEvent; use Symfony\Component\EventDispatcher\EventSubscriberInterface; /** * Alters the webform submission data that is submitted to Pardot. */ class PardotSubmissionEventSubscriber implements EventSubscriberInterface { /** * {@inheritdoc} */ public static function getSubscribedEvents(): array { return [ PardotEvent::PARDOT_DATA => 'alterPardotSubmission', ]; } /** * Alter Pardot submission. * * @param Drupal\custom_module\EventSubscribe\PardotEvent $event * The Pardot event containing the submitted data. */ public function alterPardotSubmission(PardotEvent $event): void { $webform_data = $event->getData(); // Alter the webform data here. $event->setData($webform_data ); } }