Home › Forums › Quform WordPress › Sending Value To External Scripts
- This topic has 4 replies, 2 voices, and was last updated 5 years, 3 months ago by Ally.
- AuthorPosts
- December 28, 2018 at 7:31 am #28068jvidalesParticipant
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!
January 3, 2019 at 7:35 pm #28107jvidalesParticipantHello,
Anyone that has donde this before?
Regards,
Jesus
January 4, 2019 at 5:48 pm #28120AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
January 5, 2019 at 5:32 am #28127jvidalesParticipantThanks Ally,
I’ve sent you the email.
Regards,
Jesus
January 7, 2019 at 2:18 pm #28164AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.