function EmailAction::validateConfigurationForm
Same name in other branches
- 8.9.x core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php \Drupal\Core\Action\Plugin\Action\EmailAction::validateConfigurationForm()
- 10 core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php \Drupal\Core\Action\Plugin\Action\EmailAction::validateConfigurationForm()
- 11.x core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php \Drupal\Core\Action\Plugin\Action\EmailAction::validateConfigurationForm()
Overrides ConfigurableActionBase::validateConfigurationForm
File
-
core/
lib/ Drupal/ Core/ Action/ Plugin/ Action/ EmailAction.php, line 192
Class
- EmailAction
- Sends an email message.
Namespace
Drupal\Core\Action\Plugin\ActionCode
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
if (!$this->emailValidator
->isValid($form_state->getValue('recipient')) && strpos($form_state->getValue('recipient'), ':mail') === FALSE) {
// We want the literal %author placeholder to be emphasized in the error message.
$form_state->setErrorByName('recipient', $this->t('Enter a valid email address or use a token email address such as %author.', [
'%author' => '[node:author:mail]',
]));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.