You are here

public function UserEmailChangeCancelForm::getQuestion in Email confirmer 8

Returns the question to ask the user.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup The form question. The page title will be set to this value.

Overrides ConfirmFormInterface::getQuestion

File

email_confirmer_user/src/Form/UserEmailChangeCancelForm.php, line 99

Class

UserEmailChangeCancelForm
User pending email change cancellation form.

Namespace

Drupal\email_confirmer_user\Form

Code

public function getQuestion() {
  $new_email = $this->userData
    ->get('email_confirmer_user', $this->entity
    ->id(), 'email_change_new_address');
  return $this
    ->currentUser()
    ->id() == $this->entity
    ->id() ? $this
    ->t('Are you sure you want to cancel the pending change of your email address to %email?', [
    '%email' => $new_email,
  ]) : $this
    ->t('Are you sure you want to cancel the pending change of the email address of user %user to %email?', [
    '%email' => $new_email,
    '%user' => $this->entity
      ->getDisplayName(),
  ]);
}