Skip to main content
Solved

How to check if user is subscribed or not from a hosted preferences page


Forum|alt.badge.img+1

Hi,

I have a hosted preferences page. If someone unsubscribes and comes back to the hosted preferences page it will show their interests checked off even though they unsubscribed. So In my code I would like to do  an if statement that says if they are unsubscribed uncheck the interest checkboxes.

Is there away for me to pull  the user’s email subscription status ? I tried  {{ consent }}  but it doesn’t work.

Thanks

Best answer by Brian Turcotte

Hi @sherbert!
 

It will depend on how your hosted page/integration is set up, but you could potentially accomplish this by making an API call to the Get Profile endpoint, which can return a profile’s subscription status:

 

 

 

 

 

I hope this helps get you started!

- Brian

View original
Did this topic or the replies in the thread help you find an answer to your question?

4 replies

Brian Turcotte
Forum|alt.badge.img+37

Hi @sherbert!
 

It will depend on how your hosted page/integration is set up, but you could potentially accomplish this by making an API call to the Get Profile endpoint, which can return a profile’s subscription status:

 

 

 

 

 

I hope this helps get you started!

- Brian


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 4 replies
  • June 1, 2023

Thanks Brian!

I am using a custom hosted preference page template from within Klaviyo. Am I able to make API calls from that ?

Thanks


Brian Turcotte
Forum|alt.badge.img+37

Hi @sherbert!

It’s theoretically possible, but it would likely require significant development effort. Here is a Community thread where a member established another custom workaround for a similar use case:

 

If you’re looking for further development help for your custom preference page, you can always reach out to one of our wonderful Official Klaviyo Partners!

 

Best,

Brian


Forum|alt.badge.img+1
  • Author
  • Contributor II
  • 4 replies
  • June 21, 2023

Thanks Brian I’m checking into it!