Unlock content by subscribing

Hi there,

I’d like to have a page on my site that is unlocked by a visitor entering their email address (signing up for our mailing list). Can anyone tell me how to use code to accomplish this?

Thank you!

I think you do not want people to register with user name/password (using wix-users-backend, https://www.wix.com/code/reference/wix-users-backend.html), but just get there email and then redirect to a page that can only be viewed if they really gave up their email address.

If that is so, you have 3 options:

  • store some value in session storage (emailgiven : true) and in the “secret page” check this value
  • store email in db after user has entered it, redirect to secret page with a querystring in URL (like www.mydomain.com/bonuspage?email=foo@bar.com
    and then, in the “secret page”, retrieve the querystring and check if that email exists in db, if not, show warning “Go away” (or something more polite).
  • a combination of 1 and 2: write email to collection, write to session storage, check session storage data with db on “secret page”.

Hi,
You can simply create a member’s page as explained here without using code :slight_smile:

Best,
Tal.

Hey! Can I lock content on my site? I’m starting a subscription paid service but need to give the user a lock and unlock feature when content is completed

Hey! Can I lock content on my site? I’m starting a subscription paid service but need to give the user a lock and unlock feature when content is completed