How to pass member data like user email and user key into HTML embed? Answered

Hi all! Simple quick question, how can I pass member data into HTML embed? Just looking to pass 'user-email' and 'user-key'

Comments

3 comments

  • Comment author
    A J

    Hey Alessandro De La Torre, in case you save this data in Webflow CMS or any CMS that you have access to via the page, you can embed it directly via the "Add Field" button in HTML embed dialog box.

    But in case the page you are creating is not directly connected to the members data you can try fetching the details you want via a script

    window.$memberstackDom.getCurrentMember().then((member) => {
    if (member.data) {
    var id = member.data.id;
    var emailID = member.data.auth.email;
    }
    })

    This will fetch the logged-in member's memberstack ID and email.
    Let me know if this works

    0
  • Comment author
    Duncan from Memberstack

    You can also use the attributes data-ms-member="email" and data-ms-member="id"

    0
  • Comment author
    Alessandro De La Torre

    Thank you!

    0

Please sign in to leave a comment.