Triggering Actions with Data Attributes

Article author
Josh Lopez
  • Updated

Memberstack includes several data attributes that allow you to trigger actions like resending verification emails, opening the customer portal, logging out a user, and more. These attributes make it easy to add functionality without writing any code.

Resend Verification Email

Use data-ms-action="resend-verification-email" to allow users to resend their verification email. This only works if you have email verification enabled.

<a data-ms-action="resend-verification-email" href="#"> Resend verification email </a>

Open Customer Portal

Let users manage their paid subscriptions with data-ms-action="customer-portal". This relies on Stripe's billing portal.

<a data-ms-action="customer-portal" href="#"> Manage Subscription </a>

Log Out User

Add a log out button with data-ms-action="logout". This will automatically hide if no user is logged in.

<a data-ms-action="logout" href="#"> Logout </a>

Login Redirect

Send users to their login redirect URL after logging in using data-ms-action="login-redirect".

<a data-ms-action="login-redirect" href="#"> Go To Your Content </a>

Was this article helpful?



Please sign in to leave a comment.