Skip to content
Snippets Groups Projects

Issue #3518341: simplify redirect to thank you page.

Merged Issue #3518341: simplify redirect to thank you page.
1 unresolved thread
1 unresolved thread
@@ -8,7 +8,6 @@
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\Core\Url;
use Drupal\verify_email\Service\VerifierInterface;
use Drupal\verify_email\VerifyEmailInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -101,7 +100,7 @@ public function submitForm(array &$form, FormStateInterface $form_state): void {
$this->messenger()->addStatus($this->t('The message has been sent.'));
// Redirect to the 'thank you' page of the specific entity.
$form_state->setRedirectUrl(Url::fromRoute('verify_email.' . $entity->id() . '.thanks'));
$form_state->setRedirect('verify_email.' . $entity->id() . '.thanks');
}
}
Loading