Skip to main content
Solved

Webhook unsubscribe email from klaviyo to magento 2

  • November 8, 2022
  • 1 reply
  • 387 views

Forum|alt.badge.img+2

Hi everyone

I want to create a webhook to unsubscribe the email from klaviyo. This webhook will call  api to magento2 with parram is the mail has unsubscribed. And then the email will update in magento with status : unsubscribe like klaviyo.

So please help. Thanks.

Best answer by Brian Turcotte

Hi @hung and welcome to the Community!

 

Just so I understand your use case correctly, are you looking to fire a webhook when someone unsubscribes, or a webhook that will unsubscribe a profile?

 

For webhook that will fire when users unsubscribe, I would suggest using the GET api/v1/people/exclusions endpoint to retrieve global suppressions. You will then know who is unsubscribed and anyone who’s not included in that call would be subscribed. This is also discussed in this Community thread:

 

For the latter option, you can use the DELETE /api/v2/list/{LIST_ID}/members endpoint to unsubscribe a profile from a list, as discussed in this thread:

 

I hope this helps, and thank you for using the Community!

 

-Brian

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

1 reply

Brian Turcotte
Forum|alt.badge.img+37
  • Klaviyo Alum
  • 1393 replies
  • Answer
  • November 8, 2022

Hi @hung and welcome to the Community!

 

Just so I understand your use case correctly, are you looking to fire a webhook when someone unsubscribes, or a webhook that will unsubscribe a profile?

 

For webhook that will fire when users unsubscribe, I would suggest using the GET api/v1/people/exclusions endpoint to retrieve global suppressions. You will then know who is unsubscribed and anyone who’s not included in that call would be subscribed. This is also discussed in this Community thread:

 

For the latter option, you can use the DELETE /api/v2/list/{LIST_ID}/members endpoint to unsubscribe a profile from a list, as discussed in this thread:

 

I hope this helps, and thank you for using the Community!

 

-Brian