问题
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