How to get Name, Email, Phone on a Webhook

Support forumCategory: QuestionsHow to get Name, Email, Phone on a Webhook
Juani asked 1 year ago
Hi, I'm sending a webhook with a custom function, and I'm able to send some parameters like: start, end, service, ip, among others.. but I receive empty the fields name, email and phone.   This is the code I'm using: add_action( 'ea_new_app_from_customer', 'custom_callback_function', 10, 2 ); function custom_callback_function( $appointment_id, $appointment_data ) { // Set up the data to be sent to the webhook $data = array( 'id' => $appointment_data['id'], 'location' => $appointment_data['location'], 'service' => $appointment_data['service'], 'worker' => $appointment_data['worker'], 'name' => $appointment_data['name'], 'email' => $appointment_data['email'], 'phone' => $appointment_data['phone'], 'date' => $appointment_data['date'], 'start' => $appointment_data['start'], 'end' => $appointment_data['end'], 'description' => $appointment_data['description'], 'status' => $appointment_data['status'], 'created' => $appointment_data['created'], 'ip' => $appointment_data['ip'], ); // Send the data to the webhook $response = wp_remote_post( 'webhookurl', array( 'method' => 'POST', 'body' => json_encode( $data ), 'headers' => array( 'Content-Type' => 'application/json' ) ) ); } Thanks
1 Answers
Nikola Loncar Staff answered 1 year ago
Hi have you tried to print out all values from that $appointment_data array? Best regards, Nikola