Skip to main content

I’m trying to pass a webhook through a contact form made in PHP. When I set up the trigger and test it, everything works the way it should. However, when I try testing the action, I get the following error:

 

Failed to create a prospect in WelcomeHome CRM (1.0.3)

code must be None or str, got int

 

Here’s the code I have set up that converts the form data to a JSON file:

// convert form data to json format
    $postArray = array(array("community_id" => $_POST;'community_id'], "id" => $_POST;'id'], "contact_fName" => $_POST;'contact_fName'], "contact_lName" => $_POST;'contact_lName'], "contact_email" => $_POST;'contact_email'], "contact_phone" => $_POST;'contact_phone'], "contact_message" => $_POST;'contact_message'])); //you might need to process any other post fields you have..

    $json = json_encode( $postArray,true );
    // make sure there were no problems
    //if( json_last_error() != JSON_ERROR_NONE ){
        //exit;  // do your error handling here instead of exiting
    // }
    $file = 'entries.json';
    // write to file
    //   note: _server_ path, NOT "web address (url)"!
    file_put_contents( $file, $json);

 

Someone please help me figure out why it’s not working. Thanks!