Calendly

Article author
Memberstack Team
  • Updated

You can use the new Memberstack 2.0 front-end API and the following code to pass member data into Calendly. 

The 2.0 API is asynchronous, which means member data is not available right away. If you try passing any member data to Calendly before its available, it will show up as undefined. To ensure that member data is available, you can use nest your Calendly initialization script inside of the getCurrentMember() method.

See the following code snippet as an example:

<script>
window?.$memberstackDom.getCurrentMember().then(({ data: member }) => {
let memberEmail = member.auth.email
let memberName = member.customFields["name"]
Calendly.initInlineWidget({
url: 'https://calendly.com/YOUR_LINK/30min',
prefill: {
name: memberName,
email: memberEmail,
customAnswers: {
...
}
}
});

}).catch(err => console.log(err)) // catch errors and log them to console
</script>

 

Note: Console logging the error will show an error in the browser’s developer console. This is helpful for debugging issues.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.