Свой Handler для webform
<?php
namespace Drupal\fix\Plugin\WebformHandler;
use Drupal\webform\Plugin\WebformHandler\EmailWebformHandler;
use Drupal\webform\WebformSubmissionInterface;
/**
* Emails a webform submission.
*
* @WebformHandler(
* id = "test_handler_email",
* label = @Translation("Test handler email"),
* category = @Translation("Notification"),
* description = @Translation("Sends a webform submission to a different email."),
* cardinality = \Drupal\webform\Plugin\WebformHandlerInterface::CARDINALITY_UNLIMITED,
* results = \Drupal\webform\Plugin\WebformHandlerInterface::RESULTS_PROCESSED,
* )
*/
class TestEmailWebformHandler extends EmailWebformHandler {
public function sendMessage(WebformSubmissionInterface $webform_submission, array $message) {
$message['body'] = 'test';
parent::sendMessage($webform_submission, $message);
}
}