Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
278c308
slack connection
duncanmcclean Aug 5, 2026
d1ed0fd
refactor channels request and tweak authentication error messages
duncanmcclean Aug 5, 2026
e3f3680
wip
duncanmcclean Aug 6, 2026
81613f3
mailcoach connection
duncanmcclean Aug 6, 2026
4682d32
wip
duncanmcclean Aug 6, 2026
459b94a
wip
duncanmcclean Aug 6, 2026
f863b8f
mailchimp connection
duncanmcclean Aug 6, 2026
ad3e56e
wip
duncanmcclean Aug 6, 2026
93da2f9
rework form field dropdowns
duncanmcclean Aug 7, 2026
78ca208
prevent configuring the same merge field/attribute key multiple times
duncanmcclean Aug 7, 2026
4de141e
wip
duncanmcclean Aug 7, 2026
6142f36
support for mailchimp's marketing permissions feature
duncanmcclean Aug 10, 2026
b11a3b8
support for mailchimp's groups feature
duncanmcclean Aug 10, 2026
143ad09
kit connection
duncanmcclean Aug 10, 2026
4b36116
wip
duncanmcclean Aug 10, 2026
c60c609
wip
duncanmcclean Aug 11, 2026
cf666d0
hubspot connection
duncanmcclean Aug 11, 2026
38748c6
wip
duncanmcclean Aug 11, 2026
b52b4f1
twilio sms connection
duncanmcclean Aug 12, 2026
9796db4
wip
duncanmcclean Aug 12, 2026
504f3ed
wip
duncanmcclean Aug 12, 2026
01520f3
address code review feedback on connections
duncanmcclean Aug 12, 2026
50591b9
google sheets connection
duncanmcclean Aug 13, 2026
7f4a605
wip
duncanmcclean Aug 13, 2026
76260d8
scope api caches to the configured credentials
duncanmcclean Aug 13, 2026
3fa674e
misc cleanup
duncanmcclean Aug 13, 2026
03d0d06
rely on `ConnectionLogic::passes()` for the enabled check
duncanmcclean Aug 13, 2026
a226bca
drop `connection` from translation keys
duncanmcclean Aug 13, 2026
da8e181
adopt `ConnectionRows` in the slack and twilio connections
duncanmcclean Aug 13, 2026
fa96770
improve connection empty states
duncanmcclean Aug 13, 2026
26e2737
reject mailchimp api keys without a datacenter suffix
duncanmcclean Aug 13, 2026
a8e97fb
skip subscribing when the email field is blank
duncanmcclean Aug 13, 2026
8b061da
escape mrkdwn in the slack message fallback text
duncanmcclean Aug 13, 2026
bae7ded
surface mailchimp api errors in the option fieldtypes
duncanmcclean Aug 13, 2026
7446744
guard the google sheets tabs fieldtype against out-of-order responses
duncanmcclean Aug 13, 2026
22311e8
scope the google sheets sheet cache to the configured credentials
duncanmcclean Aug 13, 2026
c783e17
guard against empty response bodies from mailcoach
duncanmcclean Aug 13, 2026
813c47f
cover the api pagination loops
duncanmcclean Aug 13, 2026
de7e820
skip subscribing to mailcoach when the email field is blank
duncanmcclean Aug 13, 2026
cffb68e
assert against the credential-scoped sheet cache key
duncanmcclean Aug 13, 2026
86c25dd
return connection failures from the tabs endpoint
duncanmcclean Aug 13, 2026
4a76931
prune marketing permission mappings when the audience changes
duncanmcclean Aug 13, 2026
e822128
mention that you can use antlers in slack message heading and twilio …
duncanmcclean Aug 17, 2026
94c2f30
refactor
duncanmcclean Aug 25, 2026
5182708
refine
duncanmcclean Aug 25, 2026
4f13c34
assert stale consent config is ignored when the form doesn't collect …
duncanmcclean Aug 25, 2026
dddb55a
avoid showing "save" button when connection still needs to be configured
duncanmcclean Aug 25, 2026
652dffb
Merge branch 'main' into connections
duncanmcclean Aug 28, 2026
ae4ef70
formatting
duncanmcclean Aug 28, 2026
1dcb436
Merge branch 'main' into connections
duncanmcclean Sep 1, 2026
607116b
update config references
duncanmcclean Sep 1, 2026
6abccba
remove duplicate import
duncanmcclean Sep 2, 2026
65e8c5c
fix mailchimp group options error for image choice fields
duncanmcclean Sep 2, 2026
dc19540
Connect - Improve icons
jaygeorge Sep 2, 2026
f2cd8ef
Add dark mode icon variants for Kit, Mailchimp, and Mailcoach
jaygeorge Sep 3, 2026
0f3e5a9
Instruction styling wip
jaygeorge Sep 3, 2026
8784802
Use prepend for command copy instead
jaygeorge Sep 4, 2026
769f571
Use inline variation
jaygeorge Sep 4, 2026
e4d20ed
Use subtle inline variation
jaygeorge Sep 4, 2026
7706fc6
Add missing copy commands
jaygeorge Sep 4, 2026
ef14e3e
Extract the steps CSS into a Vue component
jaygeorge Sep 4, 2026
ce8e4b9
Scale Slack icon down a touch
jaygeorge Sep 4, 2026
d280016
Fix webhook icon in list mode
jaygeorge Sep 4, 2026
4365e2f
Collapsed Summary
jaygeorge Sep 4, 2026
a967eee
stop passing the removed `empty-heading` prop to `ConnectionRows`
duncanmcclean Sep 7, 2026
abb590a
pass the step number to `ConnectionSetupStep` as a prop
duncanmcclean Sep 7, 2026
b46717d
always show the label and instructions above notification rows
duncanmcclean Sep 7, 2026
a219372
use the `Input` prepend slot for the encode command prompt
duncanmcclean Sep 7, 2026
cd9a7aa
rename `ConditionsCollapsedSummary` to `ConnectionRowSummary`
duncanmcclean Sep 7, 2026
4d4e144
fold the dark mode icon colours into the light icons with `light-dark()`
duncanmcclean Sep 7, 2026
48a3b40
rename form connections to connectors to match core
jasonvarga Oct 7, 2026
3b8ee61
move slack and twilio onto the base connector's hooks
jasonvarga Oct 7, 2026
e5987cc
allow multiple mailchimp, mailcoach and kit connections
jasonvarga Oct 7, 2026
2785724
allow multiple hubspot connections
jasonvarga Oct 7, 2026
425f54e
allow multiple google sheets connections, with tab options per connec…
jasonvarga Oct 7, 2026
28bbd05
block stray http requests in connector tests
jasonvarga Oct 8, 2026
74cb715
move connectors onto the base connector's blueprint hooks
jasonvarga Oct 8, 2026
0319b80
let `ConnectionList` render the connector fields
jasonvarga Oct 8, 2026
66ca87e
read the form and connections from the connector instead of passing t…
jasonvarga Oct 8, 2026
b9f5e2b
show an alert on google sheets connector for a conflict rather than a…
jasonvarga Oct 8, 2026
60d5f1b
remove `consent_field` in favour of connection conditions
jasonvarga Oct 8, 2026
d5ade7c
revert unrelated package.json and package-lock.json changes
jasonvarga Oct 8, 2026
f405acb
fail connector jobs on permanent errors instead of retrying them
jasonvarga Oct 8, 2026
4301221
fall back to the default slack heading when a custom heading renders …
jasonvarga Oct 8, 2026
aba9307
truncate the rendered twilio body to the 1600 character limit
jasonvarga Oct 8, 2026
4a44e4f
don't prepend the country code to numbers that already include it
jasonvarga Oct 8, 2026
c059870
skip hubspot tracking context in the control panel and console
jasonvarga Oct 8, 2026
046906c
send hubspot property arrays semicolon-separated and booleans as true…
jasonvarga Oct 8, 2026
9f0f8a8
fall back to other legal text for hubspot explicit consent when `cons…
jasonvarga Oct 8, 2026
8eedaf2
add mailcoach tags through the subscriber tags endpoint so existing t…
jasonvarga Oct 8, 2026
52bd74d
catch connection exceptions when validating a google sheets tab
jasonvarga Oct 9, 2026
4ea003e
don't parse config values in slack headings and twilio bodies
jasonvarga Oct 9, 2026
6e1c02d
Merge branch '1.x' into connections
jasonvarga Nov 23, 2026
3daa653
grant view form submissions permission in connector endpoint tests
jasonvarga Nov 23, 2026
24a33b2
don't resubscribe people who unsubscribed from a mailcoach list
jasonvarga Nov 23, 2026
4001f05
include group fields and render toggles properly in slack and google …
jasonvarga Nov 23, 2026
dd35c39
render option labels for yes/no, image choice and ranking fields in s…
jasonvarga Nov 23, 2026
3eab90b
warn about sms pumping when texting whoever submits a twilio form
jasonvarga Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions config/forms-pro.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,39 @@

],

'connections' => [

'google_sheets' => [
'credentials' => env('FORMS_PRO_GOOGLE_SHEETS_CREDENTIALS'),
],

'hubspot' => [
'access_token' => env('FORMS_PRO_HUBSPOT_ACCESS_TOKEN'),
],

'kit' => [
'api_key' => env('FORMS_PRO_KIT_API_KEY'),
],

'mailchimp' => [
'api_key' => env('FORMS_PRO_MAILCHIMP_API_KEY'),
],

'mailcoach' => [
'api_url' => env('FORMS_PRO_MAILCOACH_API_URL'),
'token' => env('FORMS_PRO_MAILCOACH_TOKEN'),
],

'slack' => [
'token' => env('FORMS_PRO_SLACK_TOKEN'),
],

'twilio' => [
'account_sid' => env('FORMS_PRO_TWILIO_ACCOUNT_SID'),
'api_key' => env('FORMS_PRO_TWILIO_API_KEY'),
'api_secret' => env('FORMS_PRO_TWILIO_API_SECRET'),
],

],

];
159 changes: 159 additions & 0 deletions lang/en/messages.php

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions lang/en/validation.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

return [
'google_sheets_spreadsheet_url' => 'Paste the address of a Google Sheet.',
'slack_channel' => 'Choose a Slack channel.',
'twilio_recipient' => 'Choose a form field, or type a number in full international format.',
'twilio_sender' => 'Choose a Twilio number or Messaging Service.',
];
14 changes: 14 additions & 0 deletions resources/js/components/connections/ConnectionSetupStep.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<script setup>
defineProps({
step: { type: String, required: true },
});
</script>

<template>
<span
class="mt-px flex size-6 shrink-0 items-center justify-center rounded-full bg-ui-accent-bg/10 text-xs font-semibold text-ui-accent-text dark:bg-ui-accent-bg/50 dark:text-[hsl(from_var(--theme-color-ui-accent-text)_h_s_90%)]"
aria-hidden="true"
>
{{ step }}
</span>
</template>
73 changes: 73 additions & 0 deletions resources/js/components/connections/GoogleSheetsConnector.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<script setup lang="ts">
import { ConnectionList, ConnectionSummary } from '@statamic/cms';
import { Alert, Badge, Description, Heading, Icon, Input, Label } from '@statamic/cms/ui';
import GoogleSheetsSetupInstructions from './GoogleSheetsSetupInstructions.vue';

defineEmits(['update:modelValue']);

const props = defineProps({
form: Object,
modelValue: { type: Array, default: () => [] },
errors: { type: Object, default: () => ({}) },
blueprint: Object,
meta: { type: Object, default: () => ({}) },
defaults: Object,
isConfigured: Boolean,
serviceAccount: String,
apiError: String,
reservedFields: { type: Array, default: () => [] },
});

const tabName = (sheet: { id: string; tab?: number }): string => props.meta[sheet.id]?.tab?.options?.[sheet.tab];
</script>

<template>
<div v-if="isConfigured">
<Alert v-if="apiError" variant="error" icon="alert-warning-exclamation-mark" class="mb-6">
<Heading :text="__('forms-pro::messages.google_sheets_api_error')" />
<Description :text="__(apiError)" class="mt-1" />
</Alert>

<Alert v-if="reservedFields.length" variant="warning" icon="alert-warning-exclamation-mark" class="mb-6">
<Description
v-for="field in reservedFields"
:key="field"
:text="__('forms-pro::messages.google_sheets_reserved_column', { field })"
/>
</Alert>

<div v-if="serviceAccount" class="mb-6">
<Label :text="__('Service Account')" />
<Description :text="__('forms-pro::messages.google_sheets_service_account')" class="mt-1" />
<Input :model-value="serviceAccount" read-only copyable class="mt-2 font-mono text-xs" />
</div>

<Label :text="__('Spreadsheets')" class="mb-2" />

<ConnectionList
:model-value="modelValue"
:errors
:defaults
:blueprint
:meta
name="google-sheets-connection"
:add-label="__('Add Spreadsheet')"
:description="__('forms-pro::messages.google_sheets_instructions')"
:delete-heading="__('Delete Spreadsheet')"
:delete-description="__('forms-pro::messages.google_sheets_delete_confirmation')"
:always-label="__('Always add a row')"
:if-label="__('Add a row if...')"
@update:model-value="$emit('update:modelValue', $event)"
>
<template #header="{ item: sheet, collapsed }">
<Badge size="lg" pill color="white" class="px-3 text-gray-950 gap-1">
<Icon name="forms-pro::google-sheets" class="size-3.5 me-1" />
{{ tabName(sheet) ?? __('New Spreadsheet') }}
</Badge>
<ConnectionSummary v-show="collapsed" :conditions="sheet.conditions" />
</template>
</ConnectionList>
</div>

<GoogleSheetsSetupInstructions v-else />
</template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<script setup>
import { Button, Description, Heading, Input } from '@statamic/cms/ui';
import ConnectionSetupStep from './ConnectionSetupStep.vue';

const projectUrl = 'https://console.cloud.google.com/projectcreate';
const apiUrl = 'https://console.cloud.google.com/apis/library/sheets.googleapis.com';
const serviceAccountsUrl = 'https://console.cloud.google.com/iam-admin/serviceaccounts';
const encodeCommand = 'base64 -i service-account.json';
const envVariable = 'FORMS_PRO_GOOGLE_SHEETS_CREDENTIALS=your-encoded-key';
</script>

<template>
<div
class="[&_code]:rounded-sm [&_code]:bg-gray-100 [&_code]:px-1 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-xs dark:[&_code]:bg-gray-800"
>
<Heading size="lg" :text="__('forms-pro::messages.google_sheets_setup_heading')" />
<Description class="mt-1.5" :text="__('forms-pro::messages.google_sheets_setup_intro')" />

<ol class="mt-6 space-y-6">
<li class="flex gap-4">
<ConnectionSetupStep step="1" />
<div class="flex-1 space-y-3">
<p>{{ __('forms-pro::messages.google_sheets_setup_project') }}</p>
<Button
size="sm"
icon="external-link"
:href="projectUrl"
target="_blank"
:text="__('Create a project')"
/>
</div>
</li>
<li class="flex gap-4">
<ConnectionSetupStep step="2" />
<div class="flex-1 space-y-3">
<p>{{ __('forms-pro::messages.google_sheets_setup_api') }}</p>
<Button
size="sm"
icon="external-link"
:href="apiUrl"
target="_blank"
:text="__('Enable the Sheets API')"
/>
</div>
</li>
<li class="flex gap-4">
<ConnectionSetupStep step="3" />
<div class="flex-1 space-y-3">
<p>{{ __('forms-pro::messages.google_sheets_setup_service_account') }}</p>
<Button
size="sm"
icon="external-link"
:href="serviceAccountsUrl"
target="_blank"
:text="__('Create a service account')"
/>
</div>
</li>
<li class="flex gap-4">
<ConnectionSetupStep step="4" />
<div class="flex-1">
<p>{{ __('forms-pro::messages.google_sheets_setup_key') }}</p>
</div>
</li>
<li class="flex gap-4">
<ConnectionSetupStep step="5" />
<div class="flex-1 space-y-3">
<p>{{ __('forms-pro::messages.google_sheets_setup_env') }}</p>
<Input :model-value="encodeCommand" read-only copyable class="font-mono text-xs">
<template #prepend>
<span
class="font-mono text-sm text-gray-400 select-none dark:text-gray-500"
aria-hidden="true"
>$</span
>
</template>
</Input>
<p
v-html="__('forms-pro::messages.google_sheets_setup_env_paste', { file: '<code>.env</code>' })"
/>
<Input :model-value="envVariable" read-only copyable class="font-mono text-xs" />
<Description :text="__('forms-pro::messages.google_sheets_setup_developer')" />
</div>
</li>
<li class="flex gap-4">
<ConnectionSetupStep step="6" />
<div class="flex-1">
<p
v-html="
__('forms-pro::messages.google_sheets_setup_share', {
suffix: '<code>.iam.gserviceaccount.com</code>',
})
"
/>
</div>
</li>
</ol>
</div>
</template>
129 changes: 129 additions & 0 deletions resources/js/components/connections/HubSpotConnector.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<script setup lang="ts">
import { computed } from 'vue';
import { ConnectionFields, ConnectionList, ConnectionRules, ConnectionSummary } from '@statamic/cms';
import { Alert, Badge, Description, Heading, Icon, Label } from '@statamic/cms/ui';
import HubSpotSetupInstructions from './HubSpotSetupInstructions.vue';

type Submission = {
id: string;
form?: string;
consent_to_process_field?: string;
communications?: unknown[];
legitimate_interest_subscription?: number;
};

defineEmits(['update:modelValue']);

const props = defineProps({
form: Object,
modelValue: { type: Array, default: () => [] },
errors: { type: Object, default: () => ({}) },
blueprint: Object,
meta: { type: Object, default: () => ({}) },
defaults: Object,
hubspotForms: { type: [Object, Array], default: () => ({}) },
isConfigured: Boolean,
apiError: String,
});

const hubspotForm = (submission: Submission) => props.hubspotForms?.[submission.form];

const extraValues = computed<Record<string, object>>(() =>
Object.fromEntries(
props.modelValue.map((submission: Submission) => [
submission.id,
{ consent_type: hubspotForm(submission)?.consent?.type ?? 'none' },
]),
),
);

const warnings = (submission: Submission): string[] => {
const hubspot = hubspotForm(submission);
const consent = hubspot?.consent;

return [
consent?.type === 'explicit_consent_to_process' &&
!submission.consent_to_process_field &&
'forms-pro::messages.hubspot_consent_to_process_warning',
consent &&
!['none', 'legitimate_interest'].includes(consent.type) &&
Boolean(consent.checkboxes?.length) &&
!(submission.communications ?? []).length &&
'forms-pro::messages.hubspot_communications_warning',
consent?.type === 'legitimate_interest' &&
(consent.subscription_ids ?? []).length > 1 &&
!submission.legitimate_interest_subscription &&
'forms-pro::messages.hubspot_subscription_warning',
hubspot?.captcha && 'forms-pro::messages.hubspot_captcha_warning',
hubspot && !hubspot.has_email && 'forms-pro::messages.hubspot_no_email_warning',
].filter(Boolean);
};
</script>

<template>
<div v-if="isConfigured">
<Alert v-if="apiError" variant="error" icon="alert-warning-exclamation-mark" class="mb-6">
<Heading :text="__('forms-pro::messages.hubspot_api_error')" />
<Description :text="__(apiError)" class="mt-1" />
</Alert>

<Alert
v-else-if="!Object.keys(hubspotForms).length"
variant="warning"
icon="alert-warning-exclamation-mark"
class="mb-6"
>
<Description :text="__('forms-pro::messages.hubspot_no_forms')" />
</Alert>

<Label :text="__('Forms')" class="mb-2" />

<ConnectionList
:model-value="modelValue"
:errors
:defaults
:blueprint
:meta
name="hubspot-connection"
:add-label="__('Add HubSpot Form')"
:description="__('forms-pro::messages.hubspot_instructions')"
:delete-heading="__('Delete HubSpot Form')"
:delete-description="__('forms-pro::messages.hubspot_delete_confirmation')"
@update:model-value="$emit('update:modelValue', $event)"
>
<template #header="{ item: submission, collapsed }">
<Badge size="lg" pill color="white" class="px-3 text-gray-950 gap-1">
<Icon name="forms-pro::hubspot" class="size-3.5 me-1" />
{{ hubspotForm(submission)?.name ?? __('New HubSpot Form') }}
</Badge>
<ConnectionSummary v-show="collapsed" :conditions="submission.conditions" />
</template>

<template #default="{ item: submission }">
<ConnectionRules
v-model:conditions="submission.conditions"
:always-label="__('Always send')"
:if-label="__('Send if...')"
>
<template #then>
<ConnectionFields :extra-values="extraValues[submission.id]">
<template #before>
<Alert
v-for="warning in warnings(submission)"
:key="warning"
variant="warning"
icon="alert-warning-exclamation-mark"
class="mb-4"
>
<Description :text="__(warning)" />
</Alert>
</template>
</ConnectionFields>
</template>
</ConnectionRules>
</template>
</ConnectionList>
</div>

<HubSpotSetupInstructions v-else />
</template>
Loading