Skip to content
Snippets Groups Projects

Issue #3515924: Add "check your email" page.

Merged Dhruv Mittal requested to merge issue/verify_email-3515924:3515924-add-check-your into 1.0.x
Files
4
+ 40
0
<?php
namespace Drupal\verify_email\Controller;
use Drupal\Core\Controller\ControllerBase;
use Drupal\verify_email\Entity\VerifyEmail;
/**
* Controller for handling the thank you page.
*/
class ThankYou extends ControllerBase {
/**
* Renders the thank you page.
*
* @param \Drupal\verify_email\Entity\VerifyEmail|null $entity
* The verify email entity passed from the route.
*
* @return array
* A render array.
*/
public function thankYouPage(VerifyEmail|null $entity = NULL) {
if ($entity) {
// Display the custom message.
$message = t('Please check your email and click on the included link to verify your email address.');
return [
'#markup' => $message,
'#title' => t('Thank you'),
];
}
// Fallback message in case entity doesn't exist.
return [
'#markup' => t('Something has gone wrong. Please try submitting your email address again.'),
'#title' => t('Sorry'),
];
}
}
Loading