class ScheduleEmailWebformHandler in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_scheduled_email/src/Plugin/WebformHandler/ScheduleEmailWebformHandler.php \Drupal\webform_scheduled_email\Plugin\WebformHandler\ScheduleEmailWebformHandler
Schedules a webform submission's email.
Plugin annotation
@WebformHandler(
id = "scheduled_email",
label = @Translation("Scheduled email"),
category = @Translation("Notification"),
description = @Translation("Sends a webform submission via a scheduled email."),
cardinality = \Drupal\webform\Plugin\WebformHandlerInterface::CARDINALITY_UNLIMITED,
results = \Drupal\webform\Plugin\WebformHandlerInterface::RESULTS_PROCESSED,
submission = \Drupal\webform\Plugin\WebformHandlerInterface::SUBMISSION_REQUIRED,
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\webform\Plugin\WebformHandlerBase implements WebformHandlerInterface uses WebformEntityStorageTrait, WebformEntityInjectionTrait, WebformPluginSettingsTrait
- class \Drupal\webform\Plugin\WebformHandler\EmailWebformHandler implements WebformHandlerMessageInterface uses WebformAjaxElementTrait
- class \Drupal\webform_scheduled_email\Plugin\WebformHandler\ScheduleEmailWebformHandler
- class \Drupal\webform\Plugin\WebformHandler\EmailWebformHandler implements WebformHandlerMessageInterface uses WebformAjaxElementTrait
- class \Drupal\webform\Plugin\WebformHandlerBase implements WebformHandlerInterface uses WebformEntityStorageTrait, WebformEntityInjectionTrait, WebformPluginSettingsTrait
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of ScheduleEmailWebformHandler
2 files declare their use of ScheduleEmailWebformHandler
- WebformScheduledEmailCommands.php in modules/
webform_scheduled_email/ src/ Commands/ WebformScheduledEmailCommands.php - webform_scheduled_email.drush.inc in modules/
webform_scheduled_email/ drush/ webform_scheduled_email.drush.inc - Webform scheduled email module drush commands.
File
- modules/
webform_scheduled_email/ src/ Plugin/ WebformHandler/ ScheduleEmailWebformHandler.php, line 29
Namespace
Drupal\webform_scheduled_email\Plugin\WebformHandlerView source
class ScheduleEmailWebformHandler extends EmailWebformHandler {
/**
* The current request.
*
* @var null|\Symfony\Component\HttpFoundation\Request
*/
protected $request;
/**
* The webform scheculed email manager.
*
* @var \Drupal\webform_scheduled_email\WebformScheduledEmailManagerInterface
*/
protected $scheduledEmailManager;
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
$instance = parent::create($container, $configuration, $plugin_id, $plugin_definition);
$instance->request = $container
->get('request_stack')
->getCurrentRequest();
$instance->scheduledEmailManager = $container
->get('webform_scheduled_email.manager');
return $instance;
}
/**
* {@inheritdoc}
*/
public function defaultConfiguration() {
return parent::defaultConfiguration() + [
'send' => '[date:html_date]',
'days' => '',
'unschedule' => FALSE,
'ignore_past' => FALSE,
'test_send' => FALSE,
];
}
/**
* {@inheritdoc}
*/
public function getSummary() {
$status_messages = [
WebformScheduledEmailManagerInterface::SUBMISSION_WAITING => [
'message' => $this
->t('waiting to be scheduled.'),
'type' => 'warning',
],
WebformScheduledEmailManagerInterface::SUBMISSION_QUEUED => [
'message' => $this
->t('queued to be sent.'),
'type' => 'status',
],
WebformScheduledEmailManagerInterface::SUBMISSION_READY => [
'message' => $this
->t('ready to be sent.'),
'type' => 'warning',
],
];
$cron_link = FALSE;
$build = [];
$stats = $this->scheduledEmailManager
->stats($this->webform, $this
->getHandlerId());
foreach ($stats as $type => $total) {
if (empty($total) || !isset($status_messages[$type])) {
continue;
}
$build[$type] = [
'#type' => 'webform_message',
'#message_message' => $this
->formatPlural($total, '@count email @message', '@count emails @message', [
'@message' => $status_messages[$type]['message'],
]),
'#message_type' => $status_messages[$type]['type'],
];
if ($status_messages[$type]['type'] === 'warning') {
$cron_link = TRUE;
}
}
// Display execute cron link.
if ($cron_link) {
$build['link'] = [
'#type' => 'link',
'#title' => $this
->t('Run cron task'),
'#url' => Url::fromRoute('entity.webform.scheduled_email.cron', [
'webform' => $this
->getWebform()
->id(),
'handler_id' => $this
->getHandlerId(),
]),
'#attributes' => [
'class' => [
'button',
'button--small',
],
],
'#prefix' => '<p>',
'#suffix' => '</p>',
];
}
$summary = parent::getSummary();
if ($build) {
$summary['#status'] = [
'#type' => 'details',
'#title' => $this
->t('Scheduled email status (@total)', [
'@total' => $stats['total'],
]),
'#help' => FALSE,
'#description' => $build,
];
}
return $summary;
}
/**
* {@inheritdoc}
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$webform = $this
->getWebform();
// Get options, mail, and text elements as options (text/value).
$date_element_options = [];
$elements = $this->webform
->getElementsInitializedAndFlattened();
foreach ($elements as $key => $element) {
if (isset($element['#type']) && in_array($element['#type'], [
'date',
'datetime',
'datelist',
])) {
$title = isset($element['#title']) ? new FormattableMarkup('@title (@key)', [
'@title' => $element['#title'],
'@key' => $key,
]) : $key;
$date_element_options["[webform_submission:values:{$key}:html_date]"] = $title;
}
}
$form['scheduled'] = [
'#type' => 'details',
'#title' => $this
->t('Scheduled email'),
'#open' => TRUE,
];
// Display warning about submission log.
if (!$webform
->hasSubmissionLog()) {
$form['scheduled']['warning'] = [
'#type' => 'webform_message',
'#message_type' => 'error',
'#message_message' => $this
->t('It is strongly recommended that <a href=":href">submission logging</a> is enable to track scheduled emails.', [
':href' => $webform
->toUrl('settings-submissions')
->toString(),
]),
'#message_close' => TRUE,
'#message_id' => 'webform_scheduled_email-' . $webform
->id(),
'#message_storage' => WebformMessage::STORAGE_LOCAL,
];
}
// Send date/time.
$send_options = [
'[date:html_date]' => $this
->t('Current date'),
WebformOtherBase::OTHER_OPTION => $this
->t('Custom @label…', [
'@label' => $this->scheduledEmailManager
->getDateTypeLabel(),
]),
(string) $this
->t('Webform') => [
'[webform:open:html_date]' => $this
->t('Open date'),
'[webform:close:html_date]' => $this
->t('Close date'),
],
(string) $this
->t('Webform submission') => [
'[webform_submission:created:html_date]' => $this
->t('Date created'),
'[webform_submission:completed:html_date]' => $this
->t('Date completed'),
'[webform_submission:changed:html_date]' => $this
->t('Date changed'),
],
];
if ($date_element_options) {
$send_options[(string) $this
->t('Element')] = $date_element_options;
}
$t_args = [
'@format' => $this->scheduledEmailManager
->getDateFormatLabel(),
'@type' => $this->scheduledEmailManager
->getDateTypeLabel(),
];
$form['scheduled']['send'] = [
'#type' => 'webform_select_other',
'#title' => $this
->t('Send email on'),
'#options' => $send_options,
'#other__placeholder' => $this->scheduledEmailManager
->getDateFormatLabel(),
'#other__description' => $this
->t('Enter a valid ISO @type (@format) or token which returns a valid ISO @type.', $t_args),
'#default_value' => $this->configuration['send'],
];
// Send days.
$days_options = [];
$days = [
30,
14,
7,
3,
2,
1,
];
foreach ($days as $day) {
$days_options["-{$day}"] = $this
->t('- @day days', [
'@day' => $day,
]);
}
$days = array_reverse($days);
foreach ($days as $day) {
$days_options[$day] = $this
->t('+ @day days', [
'@day' => $day,
]);
}
$form['scheduled']['days'] = [
'#type' => 'webform_select_other',
'#title' => $this
->t('Days'),
'#title_display' => 'hidden',
'#empty_option' => $this
->t('- None -'),
'#options' => $days_options,
'#default_value' => $this->configuration['days'],
'#other__option_label' => $this
->t('Custom number of days…'),
'#other__type' => 'number',
'#other__field_suffix' => $this
->t('days'),
'#other__placeholder' => $this
->t('Enter +/- days'),
];
// Ignore past.
$form['scheduled']['ignore_past'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Do not schedule email if the action should be triggered in the past'),
'#description' => $this
->t('You can use this setting to prevent an action to be scheduled if it should have been triggered in the past.'),
'#default_value' => $this->configuration['ignore_past'],
'#return_value' => TRUE,
];
// Unschedule.
$form['scheduled']['unschedule'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Unschedule email when draft or submission is saved'),
'#description' => $this
->t('You can use this setting to unschedule a draft reminder, when submission has been completed.'),
'#default_value' => $this->configuration['unschedule'],
'#return_value' => TRUE,
];
// Queue all submissions.
if ($webform
->hasSubmissions()) {
$form['scheduled']['queue'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Schedule emails for all existing submissions'),
'#description' => $this
->t('Check schedule emails after submissions have been processed.'),
'#return_value' => TRUE,
// Must specify #parents because 'queue' is not a configuration setting.
// @see \Drupal\webform_scheduled_email\Plugin\WebformHandler\ScheduleEmailWebformHandler::defaultConfiguration
// @see \Drupal\webform\Plugin\WebformHandlerBase::setSettingsParentsRecursively
'#parents' => [
'settings',
'queue',
],
];
$form['scheduled']['queue_message'] = [
'#type' => 'webform_message',
'#message_message' => $this
->t('Please note all submissions will be rescheduled, including ones that have already received an email from this handler and submissions whose send date is in the past.'),
'#message_type' => 'warning',
'#states' => [
'visible' => [
':input[name="settings[queue]"]' => [
'checked' => TRUE,
],
],
],
];
}
// Notes.
$form['scheduled']['notes'] = [
'#type' => 'details',
'#title' => $this
->t('Please note'),
];
$form['scheduled']['notes']['message'] = [
'#theme' => 'item_list',
'#items' => [
$this
->t("Only one email can be scheduled per handler and submission."),
$this
->t('Email will be rescheduled when a draft or submission is updated.'),
$this
->t("Multiple handlers can be used to schedule multiple emails."),
$this
->t('Deleting this handler will unschedule all scheduled emails.'),
[
'#markup' => $this
->t('Scheduled emails are automatically sent starting at midnight using <a href=":href">cron</a>, which is executed at predefined interval.', [
':href' => 'https://www.drupal.org/docs/7/setting-up-cron/overview',
]),
],
],
];
$form['scheduled']['token_tree_link'] = $this
->buildTokenTreeElement();
$form = parent::buildConfigurationForm($form, $form_state);
// Change 'Send email' to 'Scheduled email'.
$form['settings']['states']['#title'] = $this
->t('Schedule email');
// Development.
$form['development']['test_send'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Immediately send email when testing a webform'),
'#return_value' => TRUE,
'#default_value' => $this->configuration['test_send'],
];
return $this
->setSettingsParents($form);
}
/**
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::validateConfigurationForm($form, $form_state);
$values = $form_state
->getValues();
// Cast days string to int.
$values['days'] = (int) $values['days'];
// If token skip validation.
if (!preg_match('/^\\[[^]]+\\]$/', $values['send'])) {
$date_format = $this->scheduledEmailManager
->getDateFormat();
// Validate custom 'send on' date.
if (WebformDateHelper::createFromFormat($date_format, $values['send']) === FALSE) {
$t_args = [
'%field' => $this
->t('Send on'),
'%format' => $this->scheduledEmailManager
->getDateFormatLabel(),
'@type' => $this->scheduledEmailManager
->getDateTypeLabel(),
];
$form_state
->setError($form['settings']['scheduled']['send'], $this
->t('The %field date is required. Please enter a @type in the format %format.', $t_args));
}
}
$form_state
->setValues($values);
}
/**
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
parent::submitConfigurationForm($form, $form_state);
if ($form_state
->getValue('queue')) {
$this->scheduledEmailManager
->schedule($this
->getWebform(), $this
->getHandlerId());
}
}
/**
* {@inheritdoc}
*/
public function alterForm(array &$form, FormStateInterface $form_state, WebformSubmissionInterface $webform_submission) {
// Display warning when test email will be sent immediately.
if ($this->request
->isMethod('GET') && $this
->getWebform()
->isTest() && !empty($this->configuration['test_send'])) {
$t_args = [
'%label' => $this
->getLabel(),
];
$form['scheduled_email_handler_test_send__' . $this
->getHandlerId()] = [
'#type' => 'webform_message',
'#message_message' => $this
->t('The %label email will be sent immediately upon submission.', $t_args),
'#message_type' => 'warning',
'#message_close' => TRUE,
'#weight' => -100,
];
}
}
/**
* {@inheritdoc}
*/
public function postSave(WebformSubmissionInterface $webform_submission, $update = TRUE) {
$state = $webform_submission
->getState();
if (in_array($state, $this->configuration['states'])) {
$this
->scheduleMessage($webform_submission);
}
elseif ($this->configuration['unschedule']) {
$this
->unscheduleMessage($webform_submission);
}
}
/**
* {@inheritdoc}
*/
public function postDelete(WebformSubmissionInterface $webform_submission) {
$this
->unscheduleMessage($webform_submission);
}
/**
* {@inheritdoc}
*/
public function updateHandler() {
$this->scheduledEmailManager
->reschedule($this->webform, $this
->getHandlerId());
}
/**
* {@inheritdoc}
*/
public function deleteHandler() {
$this->scheduledEmailManager
->unschedule($this->webform, $this
->getHandlerId());
}
/**
* Schedule the sending of an email.
*
* @param \Drupal\webform\WebformSubmissionInterface $webform_submission
* A webform submission.
*
* @return bool|string
* The status of scheduled email. FALSE is email was not scheduled.
*/
protected function scheduleMessage(WebformSubmissionInterface $webform_submission) {
$t_args = [
'%submission' => $webform_submission
->label(),
'%handler' => $this
->label(),
'%send' => $this->configuration['send'],
];
// Get message to make sure there is a destination.
$message = $this
->getMessage($webform_submission);
// Don't send the message if empty (aka To, CC, and BCC is empty).
if (!$this
->hasRecipient($webform_submission, $message)) {
if ($this->configuration['debug']) {
$this
->messenger()
->addWarning($this
->t('%submission: Email <b>not sent</b> for %handler handler because a <em>To</em>, <em>CC</em>, or <em>BCC</em> email was not provided.', $t_args));
}
return FALSE;
}
// When testing send email immediately.
if ($this
->getWebform()
->isTest() && !empty($this->configuration['test_send'])) {
$this
->sendMessage($webform_submission, $message);
return TRUE;
}
// Get send date.
$send_iso_date = $this->scheduledEmailManager
->getSendDate($webform_submission, $this->handler_id);
$t_args['%date'] = $send_iso_date;
// Log and exit when we are unable to schedule an email due to an invalid
// date.
if (!$send_iso_date) {
if ($this->configuration['debug']) {
$this
->messenger()
->addWarning($this
->t('%submission: Email <b>not scheduled</b> for %handler handler because %send is not a valid date/token.', $t_args), TRUE);
}
$context = $t_args + [
'link' => $this
->getWebform()
->toLink($this
->t('Edit'), 'handlers')
->toString(),
];
$this
->getLogger()
->warning('%submission: Email <b>not scheduled</b> for %handler handler because %send is not a valid date/token.', $context);
return FALSE;
}
// Finally, schedule the email, which also writes to the submission log
// and watchdog.
$status = $this->scheduledEmailManager
->schedule($webform_submission, $this
->getHandlerId());
// Debug by displaying schedule message onscreen.
if ($this->configuration['debug']) {
$statuses = [
WebformScheduledEmailManagerInterface::EMAIL_ALREADY_SCHEDULED => $this
->t('Already Scheduled'),
WebformScheduledEmailManagerInterface::EMAIL_SCHEDULED => $this
->t('Scheduled'),
WebformScheduledEmailManagerInterface::EMAIL_RESCHEDULED => $this
->t('Rescheduled'),
WebformScheduledEmailManagerInterface::EMAIL_UNSCHEDULED => $this
->t('Unscheduled'),
WebformScheduledEmailManagerInterface::EMAIL_IGNORED => $this
->t('Ignored'),
];
$t_args['@action'] = mb_strtolower($statuses[$status]);
$this
->messenger()
->addWarning($this
->t('%submission: Email <b>@action</b> by %handler handler to be sent on %date.', $t_args), TRUE);
$debug_message = $this
->buildDebugMessage($webform_submission, $message);
$debug_message['status'] = [
'#type' => 'item',
'#title' => $this
->t('Status'),
'#markup' => $statuses[$status],
'#wrapper_attributes' => [
'class' => [
'container-inline',
],
'style' => 'margin: 0',
],
'#weight' => -10,
];
$debug_message['send'] = [
'#type' => 'item',
'#title' => $this
->t('Send on'),
'#markup' => $send_iso_date,
'#wrapper_attributes' => [
'class' => [
'container-inline',
],
'style' => 'margin: 0',
],
'#weight' => -10,
];
$this
->messenger()
->addWarning($this->renderer
->renderPlain($debug_message), TRUE);
}
return $status;
}
/**
* Unschedule the sending of an email.
*
* @param \Drupal\webform\WebformSubmissionInterface $webform_submission
* A webform submission.
*/
protected function unscheduleMessage(WebformSubmissionInterface $webform_submission) {
if ($this->scheduledEmailManager
->hasScheduledEmail($webform_submission, $this
->getHandlerId())) {
$this->scheduledEmailManager
->unschedule($webform_submission, $this
->getHandlerId());
if ($this->configuration['debug']) {
$t_args = [
'%submission' => $webform_submission
->label(),
'%handler' => $this
->label(),
];
$this
->messenger()
->addWarning($this
->t('%submission: Email <b>unscheduled</b> for %handler handler.', $t_args), TRUE);
}
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
protected | property | ||
DependencySerializationTrait:: |
public | function | 2 | |
DependencySerializationTrait:: |
public | function | 2 | |
EmailWebformHandler:: |
protected | property |
The configuration object factory. Overrides WebformHandlerBase:: |
|
EmailWebformHandler:: |
protected | property | The current user. | |
EmailWebformHandler:: |
protected | property | Cache of default configuration values. | |
EmailWebformHandler:: |
protected | property | The webform element plugin manager. | |
EmailWebformHandler:: |
protected | property | The language manager. | |
EmailWebformHandler:: |
protected | property | A mail manager for sending email. | |
EmailWebformHandler:: |
protected | property | The module handler. | |
EmailWebformHandler:: |
protected | property | The webform theme manager. | |
EmailWebformHandler:: |
protected | property |
The webform token manager. Overrides WebformHandlerBase:: |
|
EmailWebformHandler:: |
protected | function | Build attachment to be displayed via debug message and resend form. | |
EmailWebformHandler:: |
protected | function | Build debug message. | |
EmailWebformHandler:: |
protected | function | Build A select other element for email address and names. | |
EmailWebformHandler:: |
protected | function |
Build token tree element. Overrides WebformHandlerBase:: |
|
EmailWebformHandler:: |
constant | Default option value. | ||
EmailWebformHandler:: |
constant | Default value. (This is used by the handler's settings.) | ||
EmailWebformHandler:: |
constant | Default option value. | ||
EmailWebformHandler:: |
protected | function | Get message body default values, which can be formatted as text or html. | |
EmailWebformHandler:: |
protected | function | Get configuration default value. | |
EmailWebformHandler:: |
protected | function | Get configuration default values. | |
EmailWebformHandler:: |
protected | function | Get element key from webform token. | |
EmailWebformHandler:: |
public | function | Get mail configuration values. | |
EmailWebformHandler:: |
protected | function | Get the Mail System's formatter module name. | |
EmailWebformHandler:: |
public | function |
Get a fully populated email for a webform submission. Overrides WebformHandlerMessageInterface:: |
|
EmailWebformHandler:: |
protected | function | Get message file attachments. | |
EmailWebformHandler:: |
protected | function | Get message to, cc, bcc, and from email addresses. | |
EmailWebformHandler:: |
public | function |
Build message summary. Overrides WebformHandlerMessageInterface:: |
|
EmailWebformHandler:: |
public | function |
Confirm that a message has a recipient. Overrides WebformHandlerMessageInterface:: |
|
EmailWebformHandler:: |
constant | Other option value. | ||
EmailWebformHandler:: |
public | function |
Build resend message webform. Overrides WebformHandlerMessageInterface:: |
|
EmailWebformHandler:: |
public | function |
Sends and logs a webform submission message. Overrides WebformHandlerMessageInterface:: |
|
EmailWebformHandler:: |
protected | function | Check that emailing files as attachments is supported. | |
EmailWebformHandler:: |
protected | function | Check that HTML emails are supported. | |
MessengerTrait:: |
protected | property | The messenger. | 27 |
MessengerTrait:: |
public | function | Gets the messenger. | 27 |
MessengerTrait:: |
public | function | Sets the messenger. | |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
2 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
public | function | Constructs a \Drupal\Component\Plugin\PluginBase object. | 98 |
ScheduleEmailWebformHandler:: |
protected | property | The current request. | |
ScheduleEmailWebformHandler:: |
protected | property | The webform scheculed email manager. | |
ScheduleEmailWebformHandler:: |
public | function |
Alter webform submission form. Overrides WebformHandlerBase:: |
|
ScheduleEmailWebformHandler:: |
public | function |
Form constructor. Overrides EmailWebformHandler:: |
|
ScheduleEmailWebformHandler:: |
public static | function |
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… Overrides EmailWebformHandler:: |
|
ScheduleEmailWebformHandler:: |
public | function |
Gets default configuration for this plugin. Overrides EmailWebformHandler:: |
|
ScheduleEmailWebformHandler:: |
public | function |
Acts on handler after it has been removed. Overrides WebformHandlerBase:: |
|
ScheduleEmailWebformHandler:: |
public | function |
Returns a render array summarizing the configuration of the webform handler. Overrides EmailWebformHandler:: |
|
ScheduleEmailWebformHandler:: |
public | function |
Acts on deleted a webform submission before the delete hook is invoked. Overrides EmailWebformHandler:: |
|
ScheduleEmailWebformHandler:: |
public | function |
Acts on a saved webform submission before the insert or update hook is invoked. Overrides EmailWebformHandler:: |
|
ScheduleEmailWebformHandler:: |
protected | function | Schedule the sending of an email. | |
ScheduleEmailWebformHandler:: |
public | function |
Form submission handler. Overrides EmailWebformHandler:: |
|
ScheduleEmailWebformHandler:: |
protected | function | Unschedule the sending of an email. | |
ScheduleEmailWebformHandler:: |
public | function |
Acts on handler after it has been updated. Overrides WebformHandlerBase:: |
|
ScheduleEmailWebformHandler:: |
public | function |
Form validation handler. Overrides EmailWebformHandler:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 4 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
WebformAjaxElementTrait:: |
public | function | Build an Ajax element. | |
WebformAjaxElementTrait:: |
public | function | Build an Ajax element's trigger. | |
WebformAjaxElementTrait:: |
public | function | Build an Ajax element's update (submit) button. | |
WebformAjaxElementTrait:: |
public | function | Build an Ajax element's wrapper. | |
WebformAjaxElementTrait:: |
public | function | Get Ajax element update class. | |
WebformAjaxElementTrait:: |
public | function | Get Ajax element update name. | |
WebformAjaxElementTrait:: |
public | function | Get Ajax element wrapper id. | |
WebformAjaxElementTrait:: |
protected static | function | Get ajax element wrapper. | |
WebformAjaxElementTrait:: |
public static | function | Ajax element submit callback. | 2 |
WebformAjaxElementTrait:: |
public static | function | Ajax element update callback. | |
WebformAjaxElementTrait:: |
public static | function | Ajax element validate callback. | |
WebformEntityInjectionTrait:: |
public | function | Get the webform that this handler is attached to. | |
WebformEntityInjectionTrait:: |
public | function | Set webform and webform submission entity. | |
WebformEntityInjectionTrait:: |
public | function | Reset webform and webform submission entity. | |
WebformEntityInjectionTrait:: |
public | function | ||
WebformEntityInjectionTrait:: |
public | function | Set the webform that this is handler is attached to. | |
WebformEntityInjectionTrait:: |
public | function | Get the webform submission that this handler is handling. | |
WebformEntityStorageTrait:: |
protected | property | An associate array of entity type storage aliases. | |
WebformEntityStorageTrait:: |
protected | property | The entity type manager. | 5 |
WebformEntityStorageTrait:: |
protected | function | Retrieves the entity storage. | |
WebformEntityStorageTrait:: |
protected | function | Retrieves the webform submission storage. | |
WebformEntityStorageTrait:: |
protected | function | Retrieves the webform storage. | |
WebformEntityStorageTrait:: |
public | function | Implements the magic __get() method. | |
WebformHandlerBase:: |
protected | property | The webform handler's conditions. | |
WebformHandlerBase:: |
protected | property | The webform handler's conditions result cache. | |
WebformHandlerBase:: |
protected | property | The webform submission (server-side) conditions (#states) validator. | |
WebformHandlerBase:: |
protected | property | The webform handler ID. | |
WebformHandlerBase:: |
protected | property | The webform handler label. | |
WebformHandlerBase:: |
protected | property | The logger factory. | |
WebformHandlerBase:: |
protected | property | The webform variant notes. | |
WebformHandlerBase:: |
protected | property | The renderer. | 1 |
WebformHandlerBase:: |
protected | property | The webform handler status. | |
WebformHandlerBase:: |
protected | property |
The webform. Overrides WebformEntityInjectionTrait:: |
|
WebformHandlerBase:: |
protected | property |
The webform submission. Overrides WebformEntityInjectionTrait:: |
|
WebformHandlerBase:: |
protected | property | The weight of the webform handler. | |
WebformHandlerBase:: |
public | function |
Controls entity operation access to webform submission. Overrides WebformHandlerInterface:: |
1 |
WebformHandlerBase:: |
public | function |
Controls entity operation access to webform submission element. Overrides WebformHandlerInterface:: |
1 |
WebformHandlerBase:: |
public | function |
Alter webform element. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Alter webform submission webform elements. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
protected | function | Apply submitted form state to configuration. | |
WebformHandlerBase:: |
public | function |
Returns the webform handler cardinality settings. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Check handler conditions against a webform submission. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Confirm webform submission form. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Acts on a element after it has been created. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Acts on handler after it has been created and added to webform. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Acts on a element after it has been deleted. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Returns the webform handler description. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Disables the webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
protected | function | Validate form that should have tokens in it. | |
WebformHandlerBase:: |
public | function |
Enables the webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Returns the conditions the webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Gets this plugin's configuration. Overrides ConfigurableInterface:: |
|
WebformHandlerBase:: |
public | function |
Returns the unique ID representing the webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Returns the label of the webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
protected | function | Get webform or webform_submission logger. | |
WebformHandlerBase:: |
public | function |
Returns notes of the webform variant. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Get configuration form's off-canvas width. Overrides WebformHandlerInterface:: |
1 |
WebformHandlerBase:: |
public | function |
Returns the status of the webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Returns the weight of the webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Determine if the webform handler requires anonymous submission tracking. Overrides WebformHandlerInterface:: |
1 |
WebformHandlerBase:: |
public | function |
Determine if this handle is applicable to the webform. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Returns the webform handler disabled indicator. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Returns the webform handler enabled indicator. Overrides WebformHandlerInterface:: |
1 |
WebformHandlerBase:: |
public | function |
Checks if the handler is excluded via webform.settings. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Returns the webform submission is optional indicator. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Returns the webform submission is required indicator. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Returns the webform handler label. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Alter/override a webform submission webform settings. Overrides WebformHandlerInterface:: |
3 |
WebformHandlerBase:: |
public | function |
Acts on a webform submission after it is created. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Acts on loaded webform submission. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Acts on webform submissions after they are purged. Overrides WebformHandlerInterface:: |
1 |
WebformHandlerBase:: |
public | function |
Changes the values of an entity before it is created. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Acts on a webform submission before they are deleted and before hooks are invoked. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Acts on an webform submission about to be shown on a webform submission form. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Prepares variables for webform confirmation templates. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Acts on webform submissions before they are purged. Overrides WebformHandlerInterface:: |
1 |
WebformHandlerBase:: |
public | function |
Acts on a webform submission before the presave hook is invoked. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
protected | function | Replace tokens in text with no render context. | |
WebformHandlerBase:: |
public | function |
Sets the conditions for this webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Sets the configuration for this plugin instance. Overrides ConfigurableInterface:: |
|
WebformHandlerBase:: |
public | function |
Sets the id for this webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Sets the label for this webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Set notes for this webform variant. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
protected | function | Set configuration settings parents. | |
WebformHandlerBase:: |
protected | function | Set configuration settings parents. | |
WebformHandlerBase:: |
public | function |
Sets the status for this webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Sets the weight for this webform handler. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Submit webform submission form. Overrides WebformHandlerInterface:: |
4 |
WebformHandlerBase:: |
public | function |
Determine if webform handler supports conditions. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Determine if webform handler supports tokens. Overrides WebformHandlerInterface:: |
|
WebformHandlerBase:: |
public | function |
Acts on a element after it has been updated. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerBase:: |
public | function |
Validate webform submission form. Overrides WebformHandlerInterface:: |
2 |
WebformHandlerInterface:: |
constant | Value indicating a single plugin instances are permitted. | ||
WebformHandlerInterface:: |
constant | Value indicating unlimited plugin instances are permitted. | ||
WebformHandlerInterface:: |
constant | Value indicating webform submissions are not processed (i.e. email or saved) by the handler. | ||
WebformHandlerInterface:: |
constant | Value indicating webform submissions are processed (i.e. email or saved) by the handler. | ||
WebformHandlerInterface:: |
constant | Value indicating webform submissions do not have to be stored in the database. | ||
WebformHandlerInterface:: |
constant | Value indicating webform submissions must be stored in the database. | ||
WebformPluginSettingsTrait:: |
public | function | ||
WebformPluginSettingsTrait:: |
public | function | ||
WebformPluginSettingsTrait:: |
public | function | ||
WebformPluginSettingsTrait:: |
public | function |