
At Freshspace, we often say that the smallest technical details can make the biggest difference. A recent project with a dental practice using DenGro, a CRM designed for patient enquiries, highlighted exactly that. What looked like a simple mismatch between a form field and DenGro’s expected data format became an opportunity to build a robust, maintainable integration that will serve the practice for years to come.
The practice’s WordPress website we built used WPForms to capture patient enquiries. One of the key fields asked patients to select a treatment, with options like Check ups, Whitening, or Orthodontics.
WPForms’ webhook addon sent the label chosen by the patient (e.g. Check ups). But DenGro expected the slug version (e.g. check-ups). This mismatch meant enquiries weren’t being mapped correctly inside DenGro.
WPForms’ webhook addon is great for simple integrations, but it doesn’t allow you to transform field values before sending them. That meant we needed a custom solution: intercept the form submission, rewrite the values and send the payload ourselves.
We disabled the WPForms webhook addon and rebuilt the integration in PHP using WordPress’ wp_remote_post(). This gave us full control over the payload, headers and field mapping.
$slug_map = [
'Check ups' => 'check-ups',
'Emergency appointments'=> 'emergency-appointments',
'Orthodontics' => 'orthodontics',
'Whitening' => 'whitening',
'White fillings' => 'white-fillings',
'Cosmetic Dentistry' => 'cosmetic-dentistry',
'Smile Makeover' => 'smile-makeover',
'Implants' => 'implants',
'Dentures' => 'dentures',
'Crowns' => 'crowns',
'Hygienist Services' => 'hygienist-services',
];
Every WPForms field has a unique ID. We audited the form and matched each ID to DenGro’s expected keys:
$payload = [
'FirstName' => $fields[21]['value'] ?? '',
'LastName' => $fields[19]['value'] ?? '',
'EmailAddress' => $fields[1]['value'] ?? '',
'PhoneNumber' => $fields[3]['value'] ?? '',
'AreYou' => $fields[4]['value'] ?? '',
'HowCanWeHelp' => $fields[5]['value'] ?? '',
'DentalTreatment' => $slug_map[ $fields[22]['value'] ] ?? sanitize_title( $fields[22]['value'] ),
'WhichDay' => $fields[8]['value'] ?? '',
'WhatTime' => $fields[9]['value'] ?? '',
'YourMessage' => $fields[2]['value'] ?? '',
'GDPR' => $fields[17]['value'] ?? '',
'MarketingConsent' => $fields[18]['value'] ?? '',
];
$response = wp_remote_post(
'https://hooks.dengro.com/capture/44eb60e5-3c57-49e0-8d43-032d12d11277',
[
'body' => $payload,
'headers' => [
'Content-Type' => 'application/x-www-form-urlencoded',
'Secret' => 'bca4099e-9113-44e6-95ca-2ab2dca42351',
],
'method' => 'POST',
]
);
We don’t just stop at “it works.” Reliability matters. To ensure no enquiry is ever lost:
error_log( print_r( $payload, true ) );
if ( is_wp_error( $response ) || wp_remote_retrieve_response_code( $response ) !== 200 ) {
wp_mail(
'practice@example.com',
'DenGro Webhook Failed',
'Payload: ' . print_r( $payload, true )
);
}
This project highlights Freshspace’s approach:
Sometimes the difference between a working integration and a broken one is just a hyphen. By digging into the details, we turned a frustrating mismatch into a robust, future‑proof solution.