diff --git a/config/forms-pro.php b/config/forms-pro.php index 570fdd9..7cd90fa 100644 --- a/config/forms-pro.php +++ b/config/forms-pro.php @@ -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'), + ], + + ], + ]; diff --git a/lang/en/messages.php b/lang/en/messages.php index c40fac2..77ae17b 100644 --- a/lang/en/messages.php +++ b/lang/en/messages.php @@ -26,4 +26,163 @@ 'automagic_form_reset_label_instructions' => 'The label for the button that restarts the form.', 'automagic_form_reset_label_default' => 'Fill out the form again', 'automagic_form_progress' => ':progress% complete', + + 'google_sheets_description' => 'Add submissions as rows in a Google Sheet.', + 'google_sheets_instructions' => 'Add a row to a spreadsheet whenever this form receives a submission.', + 'google_sheets_delete_confirmation' => 'Are you sure you want to stop sending submissions to this spreadsheet?', + 'google_sheets_spreadsheet_instructions' => 'Paste the address from your browser\'s address bar.', + 'google_sheets_tab_instructions' => 'Rows are added to the bottom. Existing rows aren\'t changed.', + 'google_sheets_tab_no_spreadsheet' => 'Enter a spreadsheet first', + 'google_sheets_tab_placeholder' => 'Choose a tab', + 'google_sheets_fields_instructions' => 'Leave empty to include every field. Each one gets a column named after its handle, added the first time it\'s submitted. Unticking a field leaves its column and past data alone.', + 'google_sheets_service_account' => 'Statamic can only open spreadsheets that are shared with this address. It needs Editor access to add rows.', + 'google_sheets_not_found' => 'Couldn\'t open that spreadsheet. Check the address and make sure it\'s shared with :email as an Editor.', + 'google_sheets_api_error' => 'Couldn\'t connect to Google Sheets.', + 'google_sheets_reserved_column' => 'This form has a field called :field, which clashes with a column this connection adds, so its value won\'t reach your spreadsheets. Rename the field in the form\'s fields to fix this.', + + 'google_sheets_setup_heading' => 'Connect your Google account', + 'google_sheets_setup_intro' => 'Your site needs a service account before it can write to Google Sheets. You only need to do this once.', + 'google_sheets_setup_project' => 'Create a Google Cloud project, or open one you already have.', + 'google_sheets_setup_api' => 'Enable the Google Sheets API for that project. The Drive API isn\'t needed.', + 'google_sheets_setup_service_account' => 'Create a service account. Leave the optional steps empty — it doesn\'t need any roles, because you\'ll share the spreadsheet with it directly.', + 'google_sheets_setup_key' => 'On the service account\'s Keys tab, add a key and choose JSON. It downloads once and Google won\'t show it again.', + 'google_sheets_setup_env' => 'Encode the file you just downloaded by running this in your terminal:', + 'google_sheets_setup_env_paste' => 'Then copy the result into your site\'s :file file:', + 'google_sheets_setup_share' => 'Open the spreadsheet you\'d like submissions added to and share it with the service account\'s address, giving it Editor access. It\'s shown against the service account you created earlier, and ends in :suffix.', + 'google_sheets_setup_developer' => 'These steps need access to the server, so you may need a developer to do them for you. Once the key is set, reload this page.', + + 'hubspot_description' => 'Send submissions to a HubSpot form.', + 'hubspot_instructions' => 'Send submissions to a HubSpot form whenever this form receives one.', + 'hubspot_delete_confirmation' => 'Are you sure you want to stop sending submissions to this HubSpot form?', + 'hubspot_form_instructions' => 'Submissions are recorded against this form, so its workflows, follow-up emails and reporting all run as if someone filled it in on a HubSpot page.', + 'hubspot_email_field_instructions' => 'Submissions without an email address are ignored.', + 'hubspot_properties_instructions' => 'Choose which of the HubSpot form\'s fields to send. Add a field there if the one you want is missing.', + 'hubspot_property_placeholder' => 'Not sent', + 'hubspot_consent_to_process_instructions' => 'Submissions where this isn\'t ticked aren\'t sent — HubSpot rejects them.', + 'hubspot_legitimate_interest_instructions' => 'The subscription covered by the legitimate interest notice on your HubSpot form.', + 'hubspot_subscription_placeholder' => 'Choose a subscription', + 'hubspot_communications_instructions' => 'Fields left empty are recorded as declined.', + 'hubspot_communications_placeholder' => 'Not recorded', + 'hubspot_no_form' => 'Choose a HubSpot form first.', + 'hubspot_no_forms' => 'This HubSpot account doesn\'t have any forms yet. Create one in HubSpot, then reload this page.', + 'hubspot_no_consent' => 'This form doesn\'t have any consent checkboxes to map.', + 'hubspot_consent_to_process_warning' => 'This form requires consent to process data, but you haven\'t mapped a field to it. Submissions won\'t reach HubSpot until you do.', + 'hubspot_communications_warning' => 'This form has marketing consent checkboxes, but you haven\'t mapped any. Submissions will still be sent — HubSpot just won\'t record any marketing consent.', + 'hubspot_subscription_warning' => 'This form\'s legitimate interest notice covers several subscriptions, but you haven\'t chosen one. Submissions will be rejected until you do.', + 'hubspot_captcha_warning' => 'Please disable reCAPTCHA on the HubSpot form. Otherwise, HubSpot will reject submissions from Statamic.', + 'hubspot_no_email_warning' => 'This form doesn\'t collect an email address, so HubSpot can\'t create a contact from it.', + 'hubspot_api_error' => 'Couldn\'t connect to HubSpot.', + + 'hubspot_setup_heading' => 'Connect your HubSpot account', + 'hubspot_setup_intro' => 'Your site needs an access token before it can send submissions to HubSpot. You only need to do this once.', + 'hubspot_setup_key' => 'Create a service key and give it the :forms and :communications scopes.', + 'hubspot_setup_env' => 'Copy it into your site\'s :file file:', + 'hubspot_setup_tracking' => 'Optional. To link submissions to a visitor\'s browsing history, add HubSpot\'s tracking code to your site. Without it, submissions still arrive — they just show up as coming from an offline source.', + 'hubspot_setup_tracking_forms' => 'If you add it, turn off "Collect data from website forms" under Settings → Marketing → Forms in HubSpot. Otherwise HubSpot records its own copy of every submission.', + 'hubspot_setup_developer' => 'This step needs access to the server, so you may need a developer to do it for you. Once the token is set, reload this page.', + + 'kit_description' => 'Subscribe people to your Kit account.', + 'kit_instructions' => 'Subscribe people to Kit whenever this form receives a submission.', + 'kit_delete_confirmation' => 'Are you sure you want to delete this Kit subscription?', + 'kit_email_field_instructions' => 'Submissions without an email address are ignored.', + 'kit_first_name_field_instructions' => 'Kit only stores a first name. Map last name as a custom field below.', + 'kit_tags_instructions' => 'Applied to every subscriber. Existing tags are kept. Create tags in Kit first.', + 'kit_custom_fields_instructions' => 'Store extra values on the subscriber. Custom fields are defined on your account in Kit.', + 'kit_form_instructions' => 'Subscribers are attributed to this form in Kit, triggering any automations linked to it. If the form sends a confirmation email, everyone who submits gets one — they\'re subscribed either way.', + 'kit_api_error' => 'Couldn\'t connect to Kit.', + + 'kit_setup_heading' => 'Connect your Kit account', + 'kit_setup_intro' => 'Your site needs an API key before it can send subscribers to Kit. You only need to do this once.', + 'kit_setup_key' => 'Add a key under the "v4 Keys" heading (v3 keys won\'t work). Copy it straight away, as Kit won\'t show it again.', + 'kit_setup_env' => 'Copy it into your site\'s :file file:', + 'kit_setup_developer' => 'This step needs access to the server, so you may need a developer to do it for you. Once the key is set, reload this page.', + + 'mailchimp_description' => 'Subscribe people to a Mailchimp audience.', + 'mailchimp_instructions' => 'Subscribe people to an audience whenever this form receives a submission.', + 'mailchimp_delete_confirmation' => 'Are you sure you want to delete this Mailchimp subscription?', + 'mailchimp_list_instructions' => 'Where subscribers are added.', + 'mailchimp_email_field_instructions' => 'Submissions without an email address are ignored.', + 'mailchimp_tags_instructions' => 'Applied to every subscriber. Existing tags are kept.', + 'mailchimp_merge_fields_instructions' => 'Store extra values on the subscriber. Merge fields are defined on the audience in Mailchimp.', + 'mailchimp_merge_field_placeholder' => 'Choose a merge field', + 'mailchimp_merge_field_no_audience' => 'Choose an audience first', + 'mailchimp_groups_instructions' => 'Add subscribers to Mailchimp groups based on what they chose. People are only ever added, never removed.', + 'mailchimp_group_placeholder' => 'Choose a group', + 'mailchimp_group_no_audience' => 'Choose an audience first', + 'mailchimp_group_all_mapped' => 'Every group is already mapped', + 'mailchimp_group_option_placeholder' => 'Choose an option', + 'mailchimp_group_option_no_field' => 'Choose a form field first', + 'mailchimp_group_option_required' => 'Choose which option adds people to this group.', + 'mailchimp_group_option_when_checked' => 'When checked', + 'mailchimp_marketing_permissions_instructions' => 'Record GDPR consent against the contact. Permissions are configured per audience, under GDPR fields in Mailchimp.', + 'mailchimp_marketing_permissions_no_audience' => 'Choose an audience first', + 'mailchimp_marketing_permissions_not_enabled' => 'This audience doesn\'t have GDPR fields enabled, so there are no permissions to record.', + 'mailchimp_marketing_permissions_no_contacts' => 'This audience has no contacts yet, so Mailchimp won\'t tell us its permissions. Submit this form once, then reload.', + 'mailchimp_marketing_permissions_placeholder' => 'Choose a field', + 'mailchimp_skip_confirmation_instructions' => 'Subscribe people immediately. Otherwise they\'re added as pending, and won\'t receive anything until they confirm by email.', + 'mailchimp_api_error' => 'Couldn\'t connect to Mailchimp.', + + 'mailchimp_setup_heading' => 'Connect your Mailchimp account', + 'mailchimp_setup_intro' => 'Your site needs an API key before it can send subscribers to Mailchimp. You only need to do this once.', + 'mailchimp_setup_key' => 'In Mailchimp, go to Account & billing → Extras → API keys and create a key.', + 'mailchimp_setup_env' => 'Copy it into your site\'s .env file:', + 'mailchimp_setup_developer' => 'This step needs access to the server, so you may need a developer to do it for you. Once the key is set, reload this page.', + + 'mailcoach_description' => 'Subscribe people to a Mailcoach email list.', + 'mailcoach_instructions' => 'Subscribe people to a list whenever this form receives a submission.', + 'mailcoach_delete_confirmation' => 'Are you sure you want to delete this Mailcoach subscription?', + 'mailcoach_list_instructions' => 'Where subscribers are added.', + 'mailcoach_email_field_instructions' => 'Submissions without an email address are ignored.', + 'mailcoach_tags_instructions' => 'Added to every subscriber. Existing tags are kept.', + 'mailcoach_attributes_instructions' => 'Store extra values on the subscriber.', + 'mailcoach_skip_confirmation_instructions' => 'Subscribe people immediately, without asking them to confirm. Only applies to lists using double opt-in. People who have unsubscribed are never resubscribed.', + 'mailcoach_api_error' => 'Couldn\'t connect to Mailcoach.', + + 'mailcoach_setup_heading' => 'Connect your Mailcoach account', + 'mailcoach_setup_intro' => 'Your site needs an API token before it can send subscribers to Mailcoach. You only need to do this once.', + 'mailcoach_setup_token' => 'In Mailcoach, go to Account → API Tokens and create a token. Give it access to all API endpoints — "Send only" tokens can\'t manage subscribers.', + 'mailcoach_setup_env' => 'Your team\'s API URL is on that same page. Copy it and the new token into your site\'s .env file:', + 'mailcoach_setup_developer' => 'This step needs access to the server, so you may need a developer to do it for you. Once both variables are set, reload this page.', + + 'slack_channel_instructions' => 'Private channels only appear once the app has been invited to them.', + 'slack_description' => 'Post submissions to a Slack channel.', + 'slack_instructions' => 'Post to a channel whenever this form receives a submission.', + 'slack_fields_instructions' => 'Leave empty to include every field.', + 'slack_heading' => 'New :form submission', + 'slack_heading_instructions' => 'You can include submitted values using [Antlers](https://statamic.dev/frontend/antlers).', + 'slack_delete_confirmation' => 'Are you sure you want to delete this Slack notification?', + 'slack_include_fields_instructions' => 'Displays the submitted values as a table.', + 'slack_link_to_submission_instructions' => 'Add a button linking to the submission in the Control Panel.', + 'slack_api_error' => 'Couldn\'t connect to Slack.', + 'slack_truncated' => 'This submission was too long to show in full.', + 'slack_view_submission' => 'View submission', + + 'slack_setup_heading' => 'Connect your Slack workspace', + 'slack_setup_intro' => 'Slack needs to know about your site before it\'ll accept messages. You only need to do this once.', + 'slack_setup_create_app' => 'Create a Slack app in the workspace you\'d like submissions sent to.', + 'slack_setup_manifest_toggle' => 'Set it up by hand, or update an existing app', + 'slack_setup_manifest' => 'Paste this manifest into the app\'s "App Manifest" page.', + 'slack_setup_install' => 'Choose "Install to Workspace", select the workspace you\'d like to install it into, and click Allow.', + 'slack_setup_token' => 'Copy the Bot User OAuth Token from the app\'s "OAuth & Permissions" page into your site\'s :file file:', + 'slack_setup_developer' => 'This step needs access to the server, so you may need a developer to do it for you. Once :variable is set, reload this page.', + + 'twilio_description' => 'Send text messages.', + 'twilio_instructions' => 'Text someone whenever this form receives a submission.', + 'twilio_to_instructions' => 'Type a number in full international format, or pick a form field to text whoever submitted.', + 'twilio_from_instructions' => 'Numbers without SMS capability are hidden. A Messaging Service picks a sender for you if you own several.', + 'twilio_body_instructions' => 'You can include submitted values using [Antlers](https://statamic.dev/frontend/antlers). Long messages are split and billed per 160 characters — fewer if you use emoji or curly quotes.', + 'twilio_to_field_warning' => 'Texting whoever submits lets anyone trigger a text to any number, and you pay for it. Use Twilio\'s Geo Permissions to limit the countries you can text, and consider turning on SMS Pumping Protection.', + 'twilio_country_code_instructions' => 'Applied to submitted numbers that arrive without one. Leave empty to text only full international numbers.', + 'twilio_delete_confirmation' => 'Are you sure you want to delete this Twilio notification?', + 'twilio_no_senders' => 'This Twilio account has no numbers you can text from. Buy one in the console, then reload this page.', + 'twilio_api_error' => 'Couldn\'t connect to Twilio.', + + 'twilio_setup_heading' => 'Connect your Twilio account', + 'twilio_setup_intro' => 'Your site needs API credentials before it can send text messages. You only need to do this once.', + 'twilio_setup_number' => 'Buy a phone number with SMS capability.', + 'twilio_setup_geo' => 'Limit the countries you can text with Geo Permissions. If you\'ll text whoever submits a form, also turn on SMS Pumping Protection so fraudsters can\'t run up your bill with premium-rate numbers.', + 'twilio_setup_geo_button' => 'Review Geo Permissions', + 'twilio_setup_key' => 'Create a Standard API Key. Copy the SID and secret straight away, as Twilio won\'t show the secret again.', + 'twilio_setup_env' => 'Copy the key\'s SID and secret into your site\'s :file file, along with your Account SID from the Twilio console dashboard:', + 'twilio_setup_developer' => 'This step needs access to the server, so you may need a developer to do it for you. Once all three are set, reload this page.', ]; diff --git a/lang/en/validation.php b/lang/en/validation.php new file mode 100644 index 0000000..553342c --- /dev/null +++ b/lang/en/validation.php @@ -0,0 +1,8 @@ + '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.', +]; diff --git a/resources/js/components/connections/ConnectionSetupStep.vue b/resources/js/components/connections/ConnectionSetupStep.vue new file mode 100644 index 0000000..f34ee27 --- /dev/null +++ b/resources/js/components/connections/ConnectionSetupStep.vue @@ -0,0 +1,14 @@ + + + diff --git a/resources/js/components/connections/GoogleSheetsConnector.vue b/resources/js/components/connections/GoogleSheetsConnector.vue new file mode 100644 index 0000000..203fff6 --- /dev/null +++ b/resources/js/components/connections/GoogleSheetsConnector.vue @@ -0,0 +1,73 @@ + + + diff --git a/resources/js/components/connections/GoogleSheetsSetupInstructions.vue b/resources/js/components/connections/GoogleSheetsSetupInstructions.vue new file mode 100644 index 0000000..b57204a --- /dev/null +++ b/resources/js/components/connections/GoogleSheetsSetupInstructions.vue @@ -0,0 +1,99 @@ + + + diff --git a/resources/js/components/connections/HubSpotConnector.vue b/resources/js/components/connections/HubSpotConnector.vue new file mode 100644 index 0000000..d1b2191 --- /dev/null +++ b/resources/js/components/connections/HubSpotConnector.vue @@ -0,0 +1,129 @@ + + + diff --git a/resources/js/components/connections/HubSpotSetupInstructions.vue b/resources/js/components/connections/HubSpotSetupInstructions.vue new file mode 100644 index 0000000..89183ad --- /dev/null +++ b/resources/js/components/connections/HubSpotSetupInstructions.vue @@ -0,0 +1,56 @@ + + + diff --git a/resources/js/components/connections/KitConnector.vue b/resources/js/components/connections/KitConnector.vue new file mode 100644 index 0000000..cf3e135 --- /dev/null +++ b/resources/js/components/connections/KitConnector.vue @@ -0,0 +1,59 @@ + + + diff --git a/resources/js/components/connections/KitSetupInstructions.vue b/resources/js/components/connections/KitSetupInstructions.vue new file mode 100644 index 0000000..fc2f505 --- /dev/null +++ b/resources/js/components/connections/KitSetupInstructions.vue @@ -0,0 +1,38 @@ + + + diff --git a/resources/js/components/connections/MailchimpConnector.vue b/resources/js/components/connections/MailchimpConnector.vue new file mode 100644 index 0000000..03b6b4a --- /dev/null +++ b/resources/js/components/connections/MailchimpConnector.vue @@ -0,0 +1,59 @@ + + + diff --git a/resources/js/components/connections/MailchimpSetupInstructions.vue b/resources/js/components/connections/MailchimpSetupInstructions.vue new file mode 100644 index 0000000..e9c3763 --- /dev/null +++ b/resources/js/components/connections/MailchimpSetupInstructions.vue @@ -0,0 +1,30 @@ + + + diff --git a/resources/js/components/connections/MailcoachConnector.vue b/resources/js/components/connections/MailcoachConnector.vue new file mode 100644 index 0000000..b449fa0 --- /dev/null +++ b/resources/js/components/connections/MailcoachConnector.vue @@ -0,0 +1,59 @@ + + + diff --git a/resources/js/components/connections/MailcoachSetupInstructions.vue b/resources/js/components/connections/MailcoachSetupInstructions.vue new file mode 100644 index 0000000..591a40e --- /dev/null +++ b/resources/js/components/connections/MailcoachSetupInstructions.vue @@ -0,0 +1,38 @@ + + +