Plan Signup Rules (a.k.a. restrict signups by email domain)

Article author
Duncan from Memberstack

With a simple rule, you can limit plan signups based on the user's email address domain.

We also have a code snippet that you can use to block specific email domains

Let's say, for instance, you create a training course for a corporate client. With Memberstack, you can easily grant access to any company employee (with a corporate email account) and at the same time prevent the rest of the world from signing up. Here's how.

Creating a Rule

Screen_Shot_2023-02-07_at_1.19.20_PM.jpg

  1. Navigate to the plans page.
  2. Select a plan.
  3. Go to the panel on the right and expand the Signup Rules folder.
  4. Click the + Add button.

In the popup window:

  1. Enter the allowed domain.
  2. Click Save.
  3. Repeat steps to add more allowed domains. (optional)

a-1.png

Memberstack adds the rule to the plan. Click the ellipsis to edit or remove the signup rule.

a-4.png

  • BTW  This signup rule won't let you block certain email domains (e.g. prevent any user with a Yahoo email account from signing up). If you enable this feature, you block all users except people with the email domain listed in the rule. 

Testing the Rule

Memberstack displays and error message and blocks a user from signing up if the email domain does not match the rule.

a-3.png

 

That's it.

Now you know how to restrict plan signups with an email domain rule.

Was this article helpful?

Comments

10 comments

  • Comment author
    Jesper Vestergaard

    Is there a limit to how many domains you can whitelist this way?

    0
  • Comment author
    Duncan from Memberstack

    Hey Jesper 👋 I'm honestly not sure... I have not tested. How many do you need to whitelist?

    0
  • Comment author
    Jesper Vestergaard
    • Edited

    Hi Duncan! Up to around 200.

    0
  • Comment author
    Duncan from Memberstack

    Hmmm yeah, we might need to find another solution. I imagine the cap (if there is one) is around 50. 200 at the highest.

    What is your goal is limiting access to 200 emails? I wonder if there might be another way to achieve your goal. 

    0
  • Comment author
    Jesper Vestergaard

    It's for online membership for a group of institutions. The institutions pay offline and when they do, we whitelist their domains to allow their employees to get access online.

    0
  • Comment author
    Jesper Vestergaard

    Hi Duncan, did you have a chance to investigate this further. I need to let my client know if we can build their workflow on this whitelisting domains concept or not. A cap of 200 would work in our case, but a cap of 50 would not.

    0
  • Comment author
    Duncan from Memberstack

    I recommend this solution instead: https://docs.memberstack.com/hc/en-us/articles/12931245913243--Code-Blocklist-Email-Domains-during-Signup

    0
  • Comment author
    Jesper Vestergaard

    OK, so we simply blacklist all domains in the world, except for the 200 we need to whitelist? :) Thanks for trying, but it doesn't really work for us. I think the whitelist approach is the right one - it just doesn't work in our case since we can't be sure if we hit a cap or not. We have found another solution: allowing anyone to sign up, and then occasionally reviewing new sign ups screening for domains that's not on our whitelist. It's not ideal, but the client can make it work. 

    0
  • Comment author
    Duncan from Memberstack
    • Edited

    Oh sorry, I didn't make that clear. You can invert the functionality of the script so that it acts as an allow list. 

    But yes, your solutions seems great too.

    1
  • Comment author
    Jesper Vestergaard

    Ah, got it! Thanks! it might work!

    0

Please sign in to leave a comment.