How to detect and run custom code on Memberstack profile updates?
Hey all,
Tried the AI and searching around. Is there a DOM Event or something I can hook into when a user successfully saves/updates their Memberstack profile? Want to run some custom function
Comments
5 comments
Hey Justin Bull,
Have you tried exploring the member.updated event for your use-case?
Does it fit for your use-case?
Sadly since I want a user browser react to it in the front end on a Webflow site, a backend webhook doesn’t work for my use case
Otherwise I’d happily use webhooks :)
We display a "profile updated" message... is there a way to listen for that? I'm afraid I'm not sure myself.
It would be nice if a JavaScript event is emitted akin to the memberstack.ready
But yeah I can try and sniff the page for that message showing up somehow
Justin Bull, yes there is a block that becomes available & visible when the profile is updated by a user as shown in the screenshot below.
That being said, in case you want to handle it on the front-end, does any of the update call listed here make sense for your project.
i.e. Instead of having the form update the values by using the data attributes, you can trigger updating the member's details via the code mentioned in the developer docs, which will in turn give you more control over what other events / actions you want to take when this happens on the front-end.
Hope this gives you some idea.
Please sign in to leave a comment.