elementor / elementor/elementor

Form API: Submit form to Webhook

Open
#17,244 0 comments 0 reactions 0 assignees View on GitHub
mod/q*
Dominant language
PHP
Stars
7.1k
Forks
1.6k
Avg merge
1d 5h
Merged PRs (30d)
193

Description

Hi, Thanks in advance

could i use the following code after my form has been submit

```add_action( 'elementor_pro/forms/new_record', 'send_data_using_webhook' , 10, 2 );
function send_data_using_webhook( $record )
{
$raw_fields = $record->get( 'fields' );
$data = array();
foreach ( $raw_fields as $id => $field ) {
$data[ $id ] = $field['value'];
}
$curl = curl_init("https://swissonline.in/admin/index.php");
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($curl);
curl_exec($curl);
}```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.