You are here

class ContactFormMapping in Pardot Integration 2.x

Plugin to capture browser cookies and send them to pardot.

Plugin annotation


@FormMapHandlerPlugin(
 id = "contact_form_mapping",
 label = @Translation("Contact Form Mapping")
)

Hierarchy

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

Expanded class hierarchy of ContactFormMapping

File

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

Namespace

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

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

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

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

  /**
   * {@inheritdoc}
   */
  public function buildConfigurationForm($form, FormStateInterface $form_state) {
    return parent::buildConfigurationForm($form, $form_state);
  }

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

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

}

Members