WP Manifestindependent plugin directory
manifest / forms / hubspot-fallback-forms

HubSpot Fallback Forms self-updates

WordPress plugin: self-hosted HTML fallback for embedded HubSpot forms, emailed via the Mailgun API.

by Ferocious Media · github.com/jansen-ferocious/hubspot-fallback-forms · website

0stars
0forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/jansen-ferocious/hubspot-fallback-forms/archive/refs/heads/main.zip

Ships its own WordPress updater (Plugin Update Checker), so new versions show up under Dashboard → Updates.

Readme

=== HubSpot Fallback Forms === Contributors: ferociousmedia Tags: hubspot, forms, fallback, mailgun Requires at least: 5.6 Tested up to: 6.6 Requires PHP: 7.2 Stable tag: 1.1.1 License: GPLv2 or later

A safety net that replaces embedded HubSpot forms site-wide with self-hosted HTML forms emailed through the Mailgun API when HubSpot embeds are unavailable.

== Description ==

This plugin detects the standard HubSpot v2 embed (hbspt.forms.create({...})) anywhere in your rendered pages and, when you flip the master toggle on, swaps each embed for a self-hosted HTML form that mirrors the same fields, consent checkboxes, and disclaimers. Submissions are emailed to your chosen recipients through the Mailgun API.

The fallback is built from HubSpot's own public form endpoint — the same one the official embed script reads — so no API token is required. You sync each form once (while HubSpot is up) and the fields, options, consent boxes, and disclaimers are cached in your database. If HubSpot later goes down, the cached fallback keeps working.

= How it works =

  1. Settings → HubSpot Fallback.
  2. Enter your Portal ID (the portalId from your embed code) and Region (e.g. na1), then Save. No token needed.
  3. Under Cached forms, add each HubSpot form ID used across the site and click Sync form. The fields, consent boxes, and disclaimers are fetched from HubSpot's public endpoint and cached.
  4. Enter your Mailgun API key, sending domain, and API region, plus recipient emails (comma-separated).
  5. When HubSpot is down, tick Fallback mode on. Every embed is now replaced with the cached HTML form. Turn it off to restore the real embeds.

= Email =

Each submission is emailed with the subject: Hubspot Fallback Submission | <Site Title> and a table of every submitted field plus consent answers. The submitter's email (if present) is set as Reply-To.

Every submission is also saved to the database (in addition to being emailed), so nothing is lost if email delivery fails during an outage. View them under Settings → Fallback Submissions, where you can filter by form/date, open full details, delete, and Export CSV for re-import into HubSpot. Each row records whether its notification email sent or failed. Stored submissions are kept indefinitely.

= Notes =

  • Styling is synced too. With "Match the HubSpot form styling" enabled (default), the fallback renders with HubSpot's own CSS class names (hs-form, hs-input, hs-button, …) so your theme's existing form CSS applies automatically, and it also emits a scoped style block built from each form's synced theme tokens (button color, font, label/consent colors and sizes, border radius, alignment). Turn it off to use only the plugin's plain default styling.
  • Each cached form has a Preview button that renders the fallback form right on the settings page (with its synced styling) so you can eyeball it before enabling fallback mode. Submissions are disabled in the preview.
  • Each cached form also has a Send test button that emails your recipients a sample submission with every field pre-filled with dummy answers — use it to confirm Mailgun delivery before you rely on the fallback. Test emails are prefixed with [TEST] in the subject.
  • Replacement is done via output buffering, so no page edits are required — the same embed code across all your sites is handled automatically.
  • If a form ID has not been synced/cached, its original HubSpot embed is left untouched (fail-safe).
  • A hidden honeypot field provides basic spam protection.

== Changelog ==

= 1.1.1 =

  • Fix: embeds were not replaced when a page builder (e.g. Cornerstone/X) injected a non-breaking space into the embed markup. The detection now tolerates non-breaking/zero-width spaces (uses Unicode-aware matching).

= 1.1.0 =

  • Add database storage for all fallback submissions, with a Fallback Submissions admin viewer (filter, search, detail view, delete) and CSV export.
  • Add a Custom CSS setting applied to the fallback forms on the front end (and in the settings-page preview).

= 1.0.0 =

  • Initial release.

Read the full README on GitHub →