How to Setup a Webhook with Jotform

November 26, 2021

What is a Webhook?

A webhook is a technique used to send HTTP POST notifications to a URL. They can be used to connect apps together or just send data – read more.

  1. Open your form in the form builder and click on the settings tab, go to the integrations section and search WebHooks or filler the result in the dropdown with “Other”.

2. Add your WebHook URL.

To inspect or debug a webhook request, you can use RequestBin. Simply create a Request Bin and set the endpoint URL in your form’s webhook (as seen in the screenshot on step 2). Make an actual submission to your form and then check the collected data on Request Bin.


Here’s an example PHP script that you may want to try on Webhook. This is a simple mailer script that will send the form submissions data to your email through Webhook.

//convert json data to php
$result = $_REQUEST[‘rawRequest’];
$obj = json_decode($result, true);

//Change with your emails
$emailfrom = “”; //Sender or From Email
$emailto = “”; //Recipient, you can predefine or use a field value e.g. $obj[‘q4_email’]
$subject = “You’ve got a new submission”; //Email Subject Title

//Do not edit
$id = $_POST[‘submissionID’]; //Get submission ID
$submissionURL = ‘’.$id; //Construct submission URL

$headers = “From: “ . $emailfrom . “rn“;
$headers .= “Reply-To: “. $emailfrom . “rn“; //Optional
$headers .= “MIME-Version: 1.0rn“;
$headers .= “Content-Type: text/html; charset=utf-8rn“;

//New method, get data from the submissions page
$html = new DOMDocument;
$body = $html->getElementsByTagName(‘body’)->item(0);

//get html code after the body tag
foreach ($body->childNodes as $child){
    $html->appendChild($html->importNode($child, true));

//make the table responsive so it appears nicely on email
$body = $html->getElementsByTagName(‘table’);
foreach ($body as $width) {
    $width->setAttribute(‘width’, ‘100%’);
$body = $html->saveHTML();

//Send email
@mail($emailto, $subject, $body, $headers);


Make sure to replace the field names and emails with the ones from your form, you can also add fields if you prefer.

You can find more useful scripts here: Webhook PHP Script Examples.

If you have questions, post it below.

Was this guide helpful?
Contact Support:

Our customer support team is available 24/7 and our average response time is between one to two hours.
Our team can be contacted via:

Support Forum:

Contact Jotform Support:

Send Comment:

Jotform Avatar
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.