I want to allow people only with an email ending with a specific format and domain such as foo.bar@mail.school.edu to register for the site that I am building. How can I do this in the Admin Tool Bar?

  • You have to achieve this by doing programmatically. – Ajay Reddy Apr 10 '18 at 16:15
  • I was trying to avoid that because I am new to Drupal. Maybe there are some modules that allow this to be done easily. However, if this is the only way, do you how I can do this programmatically, or where I can find resources to learn how to do this through code? – ElectroMotiveHorse Apr 10 '18 at 16:25
  • Checkout this module also drupal.org/project/email_domain_restriction – Ajay Reddy Apr 10 '18 at 18:18

You can use domain_registration to allow or dissalow emails from certain domains to register.

Setup is very simple as seen from the instructions on the project page

  1. Install the module
  2. visit 'admin/config/system/domain_register'
  3. Choose if you want to only allow, or disallow the domains from registering
  4. Enter the domain names you wish to allow/deny (one per line) in the format of 'foo.com'. Wildcards are allowed.
  5. Enter the error message you wish to show to the end user if the email address doesn't validate
  • @ElectroMotiveHorse Glad I was able to help. If the question has helped or answered your question please consider voting and or accepting the answer. Voting is central in stackexhange sites and here is the reasoning drupal.stackexchange.com/help/why-vote – GiorgosK Apr 11 '18 at 4:45
  • The answer has been accepted but I do not have enough rep to vote yet in drupal answers. – ElectroMotiveHorse Apr 12 '18 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.