I am looking for a way to restrict email addresses that can be used for customer registration to a specific domain.
I can just add the "pattern" attribute to the input field, but one might just open the dev-tools, delete the pattern and use whatever email he/she wants for registration again.
Is there a way to restrict the emails to a specific domain somewhere in the settings? If not - how would I implement a custom validation for this?
Solved! Go to the solution
This is an accepted solution.
If you are willing to consider an app to achieve your goal, then I suggest looking at Customer Fields. The app's form builder has some powerful built-in validation rules which can be applied to virtually any field, including the email field. You can easily add a validation rule to the email address field on the store's registration form to force the user to match a regex, or use a specific domain for their email address. Here's a screenshot that shows an example of how to set this up in the Customer Fields app:
Hopefully this helps, Peter!