Unwanted Email Registration
This module helps prevent duplicate user registrations by identifying email addresses that are functionally the same due to domain settings that ignore certain characters. It can be configured to filter various characters and email providers, ensuring that variations of the same email address aren't registered multiple times.
The purpose of this module is to provide for duplicate email addresses checking for domains that allow extraneous characters to be placed inside usernames and be treated as different email addresses. For example:
[email protected]
[email protected]
[email protected]
Dots don't matter in Gmail addresses
All three of these email addresses go to the same Gmail account and can be registered as three different accounts in Drupal. This module catches this condition and can be set up to filter other characters and domain email providers for similar systems.
For Developers:
$moduleHandler = \Drupal::service('module_handler');
if ($moduleHandler->moduleExists('unwanted_email_registration')) {
$service = \Drupal::service('unwanted_email_registration.services');
if ($service->validateEmail($email) === FALSE) {
// Do Something here , Like Error messages
return FALSE;
}
}