Sending Value To External Scripts

Home Forums Quform WordPress Sending Value To External Scripts

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Ally 2 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #28068

    jvidales
    Participant

    Hello,

    I’m trying to follow your guide to send values to an external script (v2) but without any luck. I know the script works since I tried it with a simple html form and did the work, but when i try to run it through Quforms, i get nothing.

    I didn’t see anything in the debug log, no errors regarding this problem.

    Here’s what I have:

    **
    * Post to Kayako and start a new conversation
    *
    */

    add_action(‘quform_post_process_2’, function (array $result, Quform_Form $form){
    $data = array(
    ‘name’ => $form->getValue(‘quform_2_9′),
    ’email’ => $form->getValue(‘quform_2_10’),
    ‘subject’ => $form->getValue(‘quform_2_11’),
    ‘contents’ => $form->getValue(‘quform_2_13’)
    );

    $response = wp_remote_post(‘http://xxx.xxx/xxxx/xxxx.php’, array(
    ‘body’ => $data
    ));
    if (defined(‘WP_DEBUG’) && WP_DEBUG) {
    if (is_wp_error($response)) {
    Quform::log($response->get_error_message());
    } else {
    $code = wp_remote_retrieve_response_code($response);
    $body = wp_remote_retrieve_body($response);

    Quform::log(‘HTTP status code: ‘ . $code, $body);
    }
    }
    return $result;
    }, 10, 2);

    Please help me find out if I’m doing anything wrong.

    Thanks in advance!

    #28107

    jvidales
    Participant

    Hello,

    Anyone that has donde this before?

    Regards,

    Jesus

    #28120

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #28127

    jvidales
    Participant

    Thanks Ally,

    I’ve sent you the email.

    Regards,

    Jesus

    #28164

    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.

Be inspired. © 2018 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy