You are here

public function EmailAction::buildConfigurationForm in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php \Drupal\Core\Action\Plugin\Action\EmailAction::buildConfigurationForm()
  2. 9 core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php \Drupal\Core\Action\Plugin\Action\EmailAction::buildConfigurationForm()

File

core/lib/Drupal/Core/Action/Plugin/Action/EmailAction.php, line 163

Class

EmailAction
Sends an email message.

Namespace

Drupal\Core\Action\Plugin\Action

Code

public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
  $form['recipient'] = [
    '#type' => 'textfield',
    '#title' => t('Recipient email address'),
    '#default_value' => $this->configuration['recipient'],
    '#maxlength' => '254',
    '#description' => t('You may also use tokens: [node:author:mail], [comment:author:mail], etc. Separate recipients with a comma.'),
  ];
  $form['subject'] = [
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#default_value' => $this->configuration['subject'],
    '#maxlength' => '254',
    '#description' => t('The subject of the message.'),
  ];
  $form['message'] = [
    '#type' => 'textarea',
    '#title' => t('Message'),
    '#default_value' => $this->configuration['message'],
    '#cols' => '80',
    '#rows' => '20',
    '#description' => t('The message that should be sent. You may include placeholders like [node:title], [user:account-name], [user:display-name] and [comment:body] to represent data that will be different each time message is sent. Not all placeholders will be available in all contexts.'),
  ];
  return $form;
}