I have the latest woocommerce plugin, and I have to set a webhook to one of my URL. But I am not able to read it in my $_REQUEST and nor in $input = file_get_contents("php://input");
.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
$webhookContent = "";
$webhook = fopen('php://input' , 'rb');
while (!feof($webhook)) {
$webhookContent .= fread($webhook, 4096);
}
fclose($webhook);
mail('mail@yourdomain.com', 'test - hook', $webhookContent);
This is all it took. It will send all the body to your email