How to pass email address to webhook from mailchimp

╄→尐↘猪︶ㄣ 提交于 2019-12-23 04:06:29

问题


I am building a web app in PHP that subscribes and unsubscribes members from a mailchimp list via the API.

What I'm trying to add (and having extreme difficulty with) is use the mailchimp web hook features to pass the email address of someone that has unsubscribed through mailchimp to the hook that I have created on my app to that it will then update the database.

The app expects to receive the below url to update the database

domain.com/includes/mailchimp-update.php?email=mail@domain.com

I am unsure as how to get that from the mailchimp web hook, and can not find anything on here about it or on mailchimp, and their live help was not that helpful, so I'm really hoping someone here can help me out.


回答1:


Just in case anyone else is struggling with this, here is how I resolved it.

Using the mailchimp webhook passes an array of data via POST. To pull the email address from the array, simply use.

$email = $_POST ['data']['email'];


来源:https://stackoverflow.com/questions/21028552/how-to-pass-email-address-to-webhook-from-mailchimp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!