Skip to content

Connections - #17

Merged
jasonvarga merged 98 commits into
1.xfrom
connections
Nov 24, 2026
Merged

jasonvarga merged 98 commits into
1.xfrom
connections

Conversation

@duncanmcclean

@duncanmcclean duncanmcclean commented Aug 12, 2026 •

Copy link
Copy Markdown
Member

This pull request implements "form connections" for the following services:

  • HubSpot
  • Kit
  • Mailchimp
  • Mailcoach
  • Slack
  • Twilio

Connections can be configured from the form's Connect area in the Control Panel. You can find setup instructions for each connection in the CP.

Please review the Core PR to learn more about how form connections work.


Depends on:

duncanmcclean and others added 24 commits August 5, 2026 16:59
- replace `new Foo()->bar()` with `(new Foo)->bar()` throughout. the former is
  PHP 8.4 only, and CI still runs 8.3
- validate mailchimp audience ids as `alpha_num`, so they can't alter the
  request path or cache key. mailcoach and hubspot already validated theirs
- drop `->filter()` from the connection controllers so they rely on
  `Arr::removeNullValues()` alone, which keeps `false` rather than dropping it
- extract `ReadsSubmissionValues` for the `isChecked()` and `value()` helpers
  that were duplicated across every connection and job
- use `FakesRoles` from core now that it's exposed there

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@linear

linear Bot commented Aug 13, 2026 •

Copy link
Copy Markdown
ST-1787 Implement Autocomplete Editor

Blocked by statamic/cms#15055

  • Email
  • Slack
  • Twilio

ST-1381 Form Connections

Registration

Developers should be able to provide their own blueprint OR provide views/controllers to render a settings page. Maybe something like this, inspired by utilities:

// src/ServiceProvider.php

Form::registerConnection('zapier')
  ->blueprint(__DIR__.'/../resources/blueprints/...')
  ->routes(function ($router() {
    $router->post('/', [ZapierController::class, 'process'])->name('process');
  });

Storage

Connection settings can be stored in the form's data array:

# resources/forms/contact.yaml

title: Contact
connections:
  zapier:
    url: blah-blah-blah
    flow: yah-yah-yah
  email:
    -
      id: foo
      to: duncan@statamic.com

Emails

The functionality of email notifications should be extracted into a "connection".

It should be possible to attach logic/conditionals to emails so you can do things like "if this was selected, email this person". Would close this FR.

It's not in the designs, but another thing that would be nice to have (from personal experience) is the ability to customise the email content without creating HTML/text views. Would close this FR.

Could be nice if form emails could be re-sent on demand too. Would close this FR.

Backwards Compatibility:

For backwards compatibility reasons, it should probably read from the email key in the form data if a connections.email key doesn't exist.

The SendEmails job may have to stay where it is for now as it's possible developers dispatch the job directly from their code.

Other Connections

We still need to map out what goes in Core vs Forms Pro, but we'll probably end up building a Zapier / IFTTT integration. Maybe a generic webhooks one too?

  • Update: Just gonna build Webhooks for now, but we're planning to do specific Zapier / IFTTT post-launch.

Review in Linear

duncanmcclean and others added 5 commits August 13, 2026 17:27
changing an api key no longer serves the previous account's audiences, channels or lists for up to five minutes. hubspot, twilio and google sheets already did this — mailchimp, kit, slack and mailcoach now fingerprint their credentials the same way.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- removed the unused `skippable` flag from `GoogleSheetsException`
- guarded against a missing `lawfulBasis` key when building hubspot consent
- removed a dead null check on `request()` in `HubSpot::context()`
- `SendTwilioMessage` reads its recipient with `Arr::get` like its siblings
- `__('Loading')` instead of `__('Loading...')`, which has no translations
- fixed mixed tabs and spaces in `AddressFieldtype.vue`

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
disabled rows now fail `passes()` in core, so the separate reject is redundant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
every key already starts with the service name, and the setup keys never had it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
core's `ConnectionRows` (previously `ConnectionList`) now owns adding, duplicating, removing and dirty tracking, and the exported `connectionRows` helper builds the initial rows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jasonvarga and others added 28 commits October 7, 2026 15:30
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tion

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he form around

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The connections work doesn't need any new npm dependencies. The axios devDependency was redundant since axios is already in dependencies, and the lockfile changes were unrelated version churn, so both files are restored to match 1.x.

Co-Authored-By: Claude <noreply@anthropic.com>
Non-retryable connector exceptions (bad credentials, deleted lists/forms, invalid data, Slack channel errors, etc.) now call `fail()` rather than rethrowing, so they no longer burn through every retry and backoff. Google Sheets still retries once when the tab title came from the cache, so a renamed tab gets a fresh lookup before the job gives up.

Co-Authored-By: Claude <noreply@anthropic.com>
…blank

Slack rejects a header block with empty text, so the message never sent.

Co-Authored-By: Claude <noreply@anthropic.com>
Submitted content could push the rendered body past the limit, and Twilio's resulting error 21617 is skippable so the message was silently dropped.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Core's fake submission flow builds connection jobs inside a CP request, which sent the admin's hubspotutk cookie, IP and CP URL to HubSpot. Only capture the context on front-end requests.

Co-Authored-By: Claude <noreply@anthropic.com>
…/false

Co-Authored-By: Claude <noreply@anthropic.com>
…entToProcessText` is missing

HubSpot's submissions API requires `consent.text`, but `consentToProcessText` is optional in the form definition. Fall back to `consentToProcessCheckboxLabel`, then `privacyText` (required on explicit consent).

Co-Authored-By: Claude <noreply@anthropic.com>
…ags are kept

Passing `tags` when subscribing syncs them on an existing subscriber, which removed tags that came from other sources. The configured tags are now added through the subscriber tags endpoint using the returned subscriber uuid.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core's editConnections policy now also requires viewSubmissions (statamic/cms#15962).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mailcoach's subscribe endpoint restarts an unsubscribed address's subscription, so look the address up first and skip it if it has unsubscribed. Also corrects the tags instructions, since tags are added rather than replaced.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sheets

Fields are now filtered with collectsValue() instead of the structure category, which was dropping group fields. Groups render as one entry with a line per child. Toggles render as Yes/No in Slack and as native booleans in Google Sheets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lack and google sheets

These fields stored option keys that were written out as-is (or as JSON for rankings), unlike select, radio and checkboxes which already showed their labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Shows a warning when a notification's recipient is a form field, and adds a setup step pointing to Twilio's Geo Permissions and SMS Pumping Protection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jasonvarga
jasonvarga merged commit d18cef5 into 1.x Nov 24, 2026
14 checks passed
@jasonvarga
jasonvarga deleted the connections branch November 24, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants