Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Filter email on new user registration

0 votes
asked Sep 4, 2015 in Q2A Core by grid744
edited Sep 4, 2015 by grid744
I require a new user to be an employee of my organisation. On registration I need their registration email to have a set domain e.g. @abc.xyz.com. How and where do I use filter_email module to prevent registration going ahead if this requirement is not met by creating a text warning?
Q2A version: 1.7.1

2 Answers

+1 vote
answered Sep 10, 2015 by Ami
edited Sep 10, 2015 by Ami
Best answer

You can do little modification to an existing plugin to fit your needs . 

Add these below lines right here - https://github.com/amiyasahu/q2a-registration-blocker/blob/master/qa-registration-blocker.php#L88

 if (strpos($email, '@abc.xyz.com') === false) { 
        return 'Invalid email'; 



+1 vote
answered Sep 5, 2015 by Scott

Have you tried following the Q2A help guides? First start here and look at the directory structure and registering modules sections. Then head to the filter page for info on making filters. You'd want something along the lines of

filter_email(&$email, $olduser)
    if (strpos($email, '@abc.xyz.com') === false) {
        return 'Invalid email';