I’m looking to filter a collection list based on the email of the user logged in (via memberstack).
- I’m using the Memberstack API to obtain the member ID, Name and Email of the user logged in. This is at the site level. SEE the code snippet BELOW
- My collection list has email addresses of the user who added the entry
- I now am looking to figure out how to filter the collection list with the email of the user logged in. It seems simple since I have both data points already, but it’s proving difficult.
<script>
MemberStack.onReady.then(async function(member) {
// if member is logged in, get their data
if(member.loggedIn){
// get the metadata obj
const metadata = await member.getMetaData();
var id = member["id"]
var name = member["name"]
var email = member["email"]
//Setting Name in Welcome Dashboard and Across Pages
$('.member-id').text(id);
$('.member-name').text(name);
$('.member-email').text(email);
}
});
</script>