• Resolved yessoftmk

    (@yessoftmk)


    Guys who added a hook to
    Jetform with a curl request?
    I try:

    
    add_action( 'jet-form-builder/custom-action/m_zayavka_popup', function($request) {   
      $secret = 'a8******11'; 
      $dataMsg = [
        'secret' => $secret,
        'message' =>   'ФИО: ' . $request['field_name'] . '  Тел: ' . $request['name_phone'] . '  Адреса: '. $request['adress']
      ];
      $curl = curl_init();
      curl_setopt_array($curl, [
        CURLOPT_URL => 'https://bot.******/api/sendNotification',
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => http_build_query($dataMsg)
      ]);
      curl_exec($curl); 
      curl_close( $curl ); 
    }
    );
    

    all ok, action email – work\send, action hook – work, but “Form successfully submitted” – not working…. message not showed….
    Any tips?

Viewing 1 replies (of 1 total)
  • Thread Starter yessoftmk

    (@yessoftmk)

    reolace curl with:

    
       $secret = 'a8333333333331'; 
       $url = 'https://33333333333/api/sendNotification';
       $args = array(
    	'timeout'     => 45,
    	'method' => 'POST',
    	'body'    => array('secret' => $secret,  'message' =>   'ФИО: ' . $request['field_name'] . '  Тел: ' . $request['name_phone'] . '  Адр: '. $request['adress'] )  
    		);
    
    $response = wp_remote_post( $url, $args );
    

    and noe notify work

Viewing 1 replies (of 1 total)

The topic ‘Jetform with a curl request’ is closed to new replies.