Skip to main content

PHP Webhook Listener

Make a php file on your server and create a webhook to point to it. When data is sent to the page, it will send you an email with the data. Make sure to change the email address before using.

 

<?php
$data = file_get_contents('php://input');
$json_data = json_decode($data);
$obj = $json_data->payload;
$fname=$obj->signup->first_name;
$lname=$obj->signup->last_name;
$nid=$obj->signup->nationbuilder_id;
// Assemble the body of the email...
$message_body = <<<EOM
first name: $fname \n
last name: $lname \n
nationbuilder_id: $nid \n
EOM;
mail('[email protected]','NB Webhook Data',$message_body);
?>

 

 

Showing 1 reaction

How would you tag this suggestion?
Please check your e-mail for a link to activate your account.