You are here

protected function SubscriptionsBlockForm::getSubmitMessage in Simplenews 3.x

Same name and namespace in other branches
  1. 8.2 src/Form/SubscriptionsBlockForm.php \Drupal\simplenews\Form\SubscriptionsBlockForm::getSubmitMessage()
  2. 8 src/Form/SubscriptionsBlockForm.php \Drupal\simplenews\Form\SubscriptionsBlockForm::getSubmitMessage()

Returns a message to display to the user upon successful form submission.

Parameters

\Drupal\Core\Form\FormStateInterface $form_state: Form state object.

bool $confirm: Whether a confirmation mail is sent or not.

Return value

string A HTML message.

Overrides SubscriptionsFormBase::getSubmitMessage

1 call to SubscriptionsBlockForm::getSubmitMessage()
SubscriptionsBlockForm::submitExtra in src/Form/SubscriptionsBlockForm.php
Submit callback that subscribes to selected newsletters.

File

src/Form/SubscriptionsBlockForm.php, line 134

Class

SubscriptionsBlockForm
Add subscriptions for authenticated user or new subscriber.

Namespace

Drupal\simplenews\Form

Code

protected function getSubmitMessage(FormStateInterface $form_state, $confirm) {
  if ($confirm) {
    return $this
      ->t('You will receive a confirmation e-mail shortly containing further instructions on how to complete your subscription.');
  }
  return $this
    ->t('You have been subscribed.');
}