You are here

public function AnonymousSubscriptionAccessForm::buildForm in Mailing List 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

src/Form/AnonymousSubscriptionAccessForm.php, line 65

Class

AnonymousSubscriptionAccessForm
Builds the form to request access to own subscriptions for anonymous users.

Namespace

Drupal\mailing_list\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = [
    '#title' => $this
      ->t('Manage your subscriptions'),
    'indications' => [
      '#type' => '#markup',
      '#markup' => $this
        ->t('Enter your email address to receive a message with a link to manage your subscriptions.'),
    ],
    'email' => [
      '#type' => 'email',
      '#title' => $this
        ->t('Your email'),
      '#required' => TRUE,
    ],
    'actions' => [
      'submit' => [
        '#type' => 'submit',
        '#value' => $this
          ->t('Send'),
        '#submit' => [
          '::submitForm',
        ],
      ],
    ],
  ];
  return $form;
}