You are here

public function MailDebuggerForm::buildForm in Mail Debugger 8

Build Form function.

Overrides FormInterface::buildForm

File

src/Form/MailDebuggerForm.php, line 71

Class

MailDebuggerForm
Class MailDebuggerForm.

Namespace

Drupal\mail_debugger\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  return [
    'to' => [
      '#type' => 'email',
      '#title' => $this
        ->t('To'),
      '#required' => TRUE,
      '#default_value' => $this->storage
        ->get("to"),
    ],
    'subject' => [
      '#type' => 'textfield',
      '#title' => $this
        ->t('Subject'),
      '#required' => TRUE,
      '#default_value' => $this->storage
        ->get('subject'),
    ],
    'body' => [
      '#type' => 'textarea',
      '#title' => $this
        ->t('Subject'),
      '#required' => TRUE,
      '#default_value' => $this->storage
        ->get('body'),
    ],
    'actions' => [
      '#type' => 'actions',
      'submit' => [
        '#type' => 'submit',
        '#value' => $this
          ->t("Send"),
      ],
    ],
  ];
}