You are here

public function EmailWebformHandler::setConfiguration in Webform 8.5

Sets the configuration for this plugin instance.

Parameters

array $configuration: An associative array containing the plugin's configuration.

Overrides WebformHandlerBase::setConfiguration

File

src/Plugin/WebformHandler/EmailWebformHandler.php, line 216

Class

EmailWebformHandler
Emails a webform submission.

Namespace

Drupal\webform\Plugin\WebformHandler

Code

public function setConfiguration(array $configuration) {
  parent::setConfiguration($configuration);

  // Make sure 'default' is converted to '_default'.
  // @see https://www.drupal.org/project/webform/issues/2980470
  // @see webform_update_8131()
  // @todo Webform 8.x-6.x: Remove the below code.
  $default_configuration = $this
    ->defaultConfiguration();
  foreach ($this->configuration as $key => $value) {
    if ($value === 'default' && isset($default_configuration[$key]) && $default_configuration[$key] === static::DEFAULT_VALUE) {
      $this->configuration[$key] = static::DEFAULT_VALUE;
    }
  }
  return $this;
}