You are here

public function EmailWebformHandler::__construct in Webform 8.5

Constructs a WebformHandlerBase object.

IMPORTANT: Webform handlers are initialized and serialized when they are attached to a webform. Make sure not include any services as a dependency injection that directly connect to the database. This will prevent "LogicException: The database connection is not serializable." exceptions from being thrown when a form is serialized via an Ajax callback and/or form build.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

\Drupal\Core\Logger\LoggerChannelFactoryInterface $logger_factory: The logger factory.

\Drupal\Core\Config\ConfigFactoryInterface $config_factory: The configuration factory.

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

\Drupal\webform\WebformSubmissionConditionsValidatorInterface $conditions_validator: The webform submission conditions (#states) validator.

Overrides WebformHandlerBase::__construct

See also

\Drupal\webform\Entity\Webform::getHandlers

File

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

Class

EmailWebformHandler
Emails a webform submission.

Namespace

Drupal\webform\Plugin\WebformHandler

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, LoggerChannelFactoryInterface $logger_factory, ConfigFactoryInterface $config_factory, EntityTypeManagerInterface $entity_type_manager, WebformSubmissionConditionsValidatorInterface $conditions_validator, AccountInterface $current_user, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager, MailManagerInterface $mail_manager, WebformThemeManagerInterface $theme_manager, WebformTokenManagerInterface $token_manager, WebformElementManagerInterface $element_manager) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $logger_factory, $config_factory, $entity_type_manager, $conditions_validator);
  $this->currentUser = $current_user;
  $this->moduleHandler = $module_handler;
  $this->languageManager = $language_manager;
  $this->mailManager = $mail_manager;
  $this->themeManager = $theme_manager;
  $this->tokenManager = $token_manager;
  $this->elementManager = $element_manager;
}