Created
December 17, 2024 08:37
-
-
Save moxet/83bdabca265aad94fec4d45933ecd53a to your computer and use it in GitHub Desktop.
Jet Form Builder to Monday.com CRM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Use below code in your function.php or code snippet, Open your Jet Form Builder form and insert a hook in action, name your hook as monday. make sure the name of the field map in the requested variable below. | |
add_action('jet-form-builder/custom-action/monday', function( $request, $action_handler ) { | |
$name = $_REQUEST["full_name"]; | |
$email = $_REQUEST["email"]; | |
$contact_number = $_REQUEST["contact_number"]; | |
$message = $_REQUEST["message"]; | |
$token = 'API_KEY_GOES_HERE'; | |
$apiUrl = 'https://api.monday.com/v2'; | |
$headers = ['Content-Type: application/json', 'Authorization: ' . $token]; | |
$query = 'mutation ($myItemName: String!, $columnVals: JSON!) { create_item (board_id:1734976586, item_name:$myItemName, column_values:$columnVals) { id } }'; | |
$date = date("Y-m-d"); | |
$vars = [ | |
'myItemName' => $name, | |
'columnVals' => json_encode([ | |
'long_text4' => $message, | |
'contact_email' => ['email'=> $email, 'text'=> $email], | |
'date_mkka9zch' => ['date' => $date], | |
'contact_phone' => ['phone' => $contact_number], | |
'status' => ['label' => 'Created'] | |
]) | |
]; | |
$data = @file_get_contents($apiUrl, false, stream_context_create([ | |
'http' => [ | |
'method' => 'POST', | |
'header' => $headers, | |
'content' => json_encode(['query' => $query, 'variables' => $vars]), | |
] | |
])); | |
$responseContent = json_decode($data, true); | |
echo json_encode($responseContent); | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Jet Form Builder Layout

Monday.com Insertion
