''); public function is_connected(){return!empty($this->credentials['webhook_url']);} public function admin_widget($prev=array()){ $c = $this->get_credentials(); $int = wmf_get_integrations(); $act = $int->action_update; $nonce= wp_create_nonce($act); $conn = $this->is_connected(); echo '
'; if($conn) echo '
✓ Verbunden
'; echo '
'; echo ''; echo ''; echo ''; echo '

'; echo ''; echo 'In Zapier: Neuer Zap → Trigger "Webhooks by Zapier" → "Catch Hook" → URL kopieren.

'; echo '

'; echo '
'; echo '
'; } public function load(){add_action('wmf_form_submitted',array($this,'send'),10,5);} public function send($form_id,$meta,$fields,$values,$sub_id){ if(!$this->is_connected()) return; wp_remote_post($this->credentials['webhook_url'],array( 'body'=>wp_json_encode(array('form_id'=>$form_id,'submission_id'=>$sub_id,'data'=>$values,'site'=>get_site_url(),'date'=>current_time('c'))), 'headers'=>array('Content-Type'=>'application/json'),'timeout'=>5,'blocking'=>false, )); } }