Hi! im deploying an app for shipping and this use two weebhooks one when a orden has fulfilment and the other is to know when the app, this webhooks what i want to is send me the data an email.
im using this code and the response i got is only "1"
<?php $webhook_content = ''; $webhook = fopen('php://input' , 'rb'); while ( !feof($webhook)) { $webhook_content .= fread($webhook, 10240); } fclose($webhook); $data = json_decode($webhook_content, true); $to = "info@shipping.com"; $subject = "new shipping"; $mail_body = '<html><body bgcolor="#ffffcc" topmargin="25"><p>Shipping data: ' . print_r($data) . ' </p></body></html>'; $headers = "From:info@localhost\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $mail_body, $headers); ?>
Greetings!