Skip to content
Try free for 15 days
English
EnglishFrenchSoonItalianSoonJapaneseSoonSpanishSoonPortuguese (Portugal)SoonGermanSoonCzechSoonDanishSoonFinnishSoonKoreanSoonNorwegian (Bokmål)SoonDutchSoonPolishSoonPortuguese (Brazil)SoonTurkishSoonChinese (Simplified)SoonChinese (Traditional)Soon
Open in Claude Ask questions about this pageOpen in ChatGPT Ask questions about this page

Email contains

Match logged-in customers whose email address contains a given string, such as a company domain.

The Email contains rule checks whether the logged-in customer’s email address contains a specific piece of text. It’s most useful for matching an entire company by their email domain, without needing to tag every individual account.

The rule only looks at the email of a customer who is currently signed in — a guest without a session has no email for the rule to check. You give it one or more strings to look for; the rule matches if the customer’s email contains any of them.

To match more than one string, separate them with the word or in the same field — for example, entering @wholesaleco.com or @partnerco.com matches any customer whose email contains either domain.

  1. Open the lock you want to protect and click the Unlock rules tab.

  2. Add an access rule and choose Email contains from the Condition type dropdown.

    Access rule picker with Email contains selected and a text field for the match string

    Adding the Email contains rule and entering the text to match.

  3. Enter the text to match — for example a company email domain like @wholesaleco.com. Add more strings separated by “or” if you need to match several domains or addresses.

  4. Choose whether the rule should match If (the email contains the string) or Unless (it doesn’t).

  5. Optionally set a per-rule Redirect URL.

  6. Save the lock.

Example: Allow employees with an approved company email

Section titled “Example: Allow employees with an approved company email”

Suppose an internal resources page should only be available to signed-in customers whose email address contains @acme.com.

  1. Select the Company resources page as the content to protect.

The Lock setup tab with Specific Page as the content type and the Company resources page listed under Restricted pages.

Pick the internal page you want to gate.

  1. On the Unlock rules tab, the first condition already defaults to Logged-in customers — leave it. Click Add key condition to add a second condition in the same access key and set it to Email contains.
  2. For Email contains, choose If and enter @acme.com in the Email address field.

The second condition set to Email contains with Rule logic If and @acme.com in the Email address field.

The condition heading confirms it: If the customer email matches @acme.com.

  1. Leave the rules’ Redirect URL fields empty.

  2. Set the messages to:

    • Guest message content: Sign in with your approved company email to continue.
    • Access denied message: Your email address is not approved for this resource.

The Messages card showing both the Guest message content and Access denied message fields filled in with the example wording.

This rule needs both messages, because either kind of visitor can be blocked.

  1. Click Save.
  • A signed-out visitor sees the Guest message and the sign-in option.
  • A signed-in customer such as [email protected] passes both conditions and can open the page.
  • A signed-in customer such as [email protected] sees the Access denied message because their email does not contain @acme.com.

The Company resources page displaying the configured email-not-approved message.

A signed-in customer using an email outside the approved domain sees the Access denied message from this example.

Was this helpful?