You are here

class WebformMapping in Pardot Integration 2.x

Plugin to capture browser cookies and send them to pardot.

Plugin annotation


@FormMapHandlerPlugin(
 id = "webform_mapping",
 label = @Translation("Webform Mapping")
)

Hierarchy

  • class \Drupal\pardot\Plugin\FormMapHandlerPlugin\WebformMapping extends \Drupal\pardot\Plugin\FormMapHandlerPluginBase

Expanded class hierarchy of WebformMapping

File

src/Plugin/FormMapHandlerPlugin/WebformMapping.php, line 17

Namespace

Drupal\pardot\Plugin\FormMapHandlerPlugin
View source
class WebformMapping extends FormMapHandlerPluginBase {

  /**
   * {@inheritdoc}
   */
  public function getPluginId() {
    return 'webform_mapping';
  }

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    return [
      'entity_types' => [],
      'entity_type_id' => 'webform',
      'entity_id' => '',
    ] + parent::defaultConfiguration();
  }

  /**
   * {@inheritdoc}
   */
  public function getPluginDefinition() {
    return $this->pluginDefinition;
  }

  /**
   * {@inheritdoc}
   */
  public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
    parent::submitConfigurationForm($form, $form_state);
  }

  /**
   * {@inheritdoc}
   */
  public function injectRequiredFields(FormMap $pardot_form_map) {
    $pardot_form_map
      ->appendMappedField('\\Drupal\\pardot\\MappedEmailField', 'email', 'webform_submission_value', [], [
      'entity_id' => $this->configuration['entity_type_id'] . ':' . $this->configuration['entity_id'],
    ]);
  }

}

Members