Solved

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

  • 25 May 2023
  • 4 replies
  • 178 views

Badge

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

icon

Best answer by Brian Turcotte 26 May 2023, 00:45

View original

4 replies

Userlevel 7
Badge +35

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

Badge

Thanks Brian!

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

Thanks

Userlevel 7
Badge +35

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

Badge

Thanks Brian I’m checking into it!

Reply