30knees Posted January 3, 2018 Share Posted January 3, 2018 Hi, A customer was able to sign up with a gmailcom address (dot missing). I think the shop software should validate the address and require a dot in the part after the @. Is there a way we could implement this? Link to comment Share on other sites More sharing options...
0 Beeta Posted January 3, 2018 Share Posted January 3, 2018 about validation, I don't know if is already possible but think about the possibility to allow of emails like: username+test@domain.ext https://www.cs.rutgers.edu/~watrous/plus-signs-in-email-addresses.html Link to comment Share on other sites More sharing options...
0 Lathaneo Posted January 5, 2018 Share Posted January 5, 2018 Hi, You can implement this with an override. Just create a file named Validate.php in directories override\classes So you get your file at override\classes\Validate.php In Validate.php, just write: ``` <?php class Validate extends ValidateCore { public static function isEmail($email) { if (empty($email) || !pregmatch(Tools::cleanNonUnicodeSupport('/^[a-z\p{L}0-9!#$%&\'*+\/=?^{}|~_-]+[.a-z\p{L}0-9!#$%&\'*+\/=?^{}|~-]@[a-z\p{L}0-9]+(?:[.]?[_a-z\p{L}0-9-]).[a-z\p{L}0-9]+$/ui'), $email)) return false; try { \Swift_Message::newInstance()->setFrom($email); return true; } catch (\Exception $e) { return false; } } } ``` Clean the cache (especially class_index.php), and it's works. Regards. Link to comment Share on other sites More sharing options...
0 30knees Posted January 6, 2018 Author Share Posted January 6, 2018 Thanks, @Lathaneo! @mdekker But is there a strong use case for email addresses without a TLD for an online shop? I would assume the only place where that would be required is with a type of localhost domain, but not for any true customer email address. Link to comment Share on other sites More sharing options...
0 vaynenick Posted March 12, 2018 Share Posted March 12, 2018 Hope this will help you...email address validation Link to comment Share on other sites More sharing options...
Question
30knees
Hi,
A customer was able to sign up with a gmailcom address (dot missing).
I think the shop software should validate the address and require a dot in the part after the @.
Is there a way we could implement this?
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now