1. Add the endpoint to wp-config.php
Add these two lines towp-config.php, above the line that reads /* That's all, stop editing! */. Use the facility’s own values.
wp-config.php
2. Add the snippet
Create the filewp-content/mu-plugins/carescale-forms.php with the content below. A must-use plugin loads on every request and can’t be switched off by accident. If the mu-plugins folder doesn’t exist, create it.
wp-content/mu-plugins/carescale-forms.php
- It runs after each submission is saved, and skips entries Gravity Forms flags as spam.
- It sends the entry plus the form’s title and fields: each field’s label, type, visible inputs and choices. Layout fields and captchas are left out.
- It sends JSON with
Authorization: Bearerand the secret, and waits up to 10 seconds. - When the delivery fails, it writes an error to the Gravity Forms log. Logging is off by default, so turn it on only while you troubleshoot.
gform_after_submission to gform_after_submission_ followed by the form ID, for example gform_after_submission_3. For several forms, add one add_action line per form.
Limits to know
- No retry. The snippet sends each entry once. If the site can’t reach Carescale at that moment, the entry isn’t sent. The Carescale card shows a refused delivery under Last rejected delivery. A delivery that never arrives shows nothing.
- Not Spam entries are never sent. An entry flagged as spam is skipped. Marking it Not Spam later doesn’t run the snippet again, so enter that person as a lead by hand.
- It runs in the visitor’s request. The visitor sees the confirmation once Carescale answers, which normally takes well under a second.
- You maintain it. Keep the file when the site moves hosts or themes.
Test it
- Submit the form on the live site with made-up details: a 555 phone number and an
example.comemail. - In Carescale, the card reads Receiving, the form appears in the forms list under its title, and a new lead is at New.
- Clear the test lead with Not an inquiry.