public function EmailAction::validateConfigurationForm in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/action/src/Plugin/Action/EmailAction.php \Drupal\action\Plugin\Action\EmailAction::validateConfigurationForm()
Form validation handler.
Parameters
array $form: An associative array containing the structure of the plugin form as built by static::buildConfigurationForm().
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the complete form.
Overrides ConfigurableActionBase::validateConfigurationForm
File
- core/
modules/ action/ src/ Plugin/ Action/ EmailAction.php, line 197 - Contains \Drupal\action\Plugin\Action\EmailAction.
Class
- EmailAction
- Sends an email message.
Namespace
Drupal\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', t('Enter a valid email address or use a token email address such as %author.', array(
'%author' => '[node:author:mail]',
)));
}
}