Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
789 views
in Q2A Core by
edited by
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

+2 votes
by
edited by
 
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
by

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';
}

 

...