=== FinchSend ===
Tags: newsletter, signup, email, double-opt-in
Requires at least: 6.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Collect newsletter subscribers in your FinchSend application.

== Installation / Instalacja ==

1. WordPress: Wtyczki → Dodaj nową → Wyślij wtyczkę na serwer.
2. Upload finchsend-wordpress.zip and activate FinchSend.
3. In FinchSend open Forms / Formularze and create an inline or pop-up form.
4. Expand Install in WordPress / Instalacja w WordPressie. Copy the application
   HTTPS origin (no path) and public form token to Settings → FinchSend in WordPress.
5. For an inline form, add [finchsend] in a Shortcode / Krótki kod block.
6. For a site-wide pop-up, set a separate pop-up form token and enable the pop-up.
7. Save, publish, and test with your email address. Confirm the email and check
   that the contact is active in the correct FinchSend account.

== Usage ==

[finchsend]
[finchsend token="YOUR_PUBLIC_FORM_TOKEN" locale="en"]

Works with the built-in WordPress Shortcode block and editors that process
WordPress shortcodes. No separate Gutenberg block or API key is required.
Only administrators can change connection settings. Use a trusted FinchSend
HTTPS origin: the browser will run the form script served by that application.
Each public token displays once per page. Use distinct inline and pop-up tokens.
The loader only accepts form scripts from the administrator-configured origin
and the exact public form endpoint; post HTML cannot select another script origin.
The form type, heading and copy are controlled by FinchSend, not the shortcode.
Language selects built-in labels and errors; form copy uses the text saved in
FinchSend. The pop-up delay is 0–300 seconds. Automatic opening occurs once per
browser tab session; a button reopens it. If sessionStorage is blocked, visitors
can still open the pop-up using the button.

== External service and privacy ==

This plugin requires a running FinchSend installation with public HTTPS access
and working email delivery. Set APP_URL to its canonical public HTTPS origin.
Without RESEND_API_KEY the application uses dry-run mode and does not deliver
confirmation messages. No paid WordPress account or FinchSend secret is needed
to embed an existing public form.

On pages with a form, the browser requests JavaScript from your configured
FinchSend origin at /api/forms/{publicToken}/embed.js. That server receives the
visitor's IP and standard HTTP metadata when the script loads. On submission,
the visitor's email and optional first name go directly to
/api/forms/{publicToken}/submissions on that origin. The form presents a required
consent checkbox. FinchSend stores new contacts as unverified and sends an email
confirmation; activation requires clicking that link. Existing unsubscribed or
bounced contacts are not reactivated automatically.

The plugin stores connection preferences only in WordPress, not submissions.
It does not synchronize WordPress users, WooCommerce buyers or existing contacts.
Document your own FinchSend service, its privacy policy and terms in your site's
privacy notice. Service URLs and operator policies depend on your installation.
Uninstalling removes the current site's plugin settings; FinchSend contacts stay
in the application. For multisite, configure/clean up each site separately.

== Troubleshooting ==

If no form appears, check the saved HTTPS origin and public token. The token is
found in FinchSend's WordPress installation panel, not the form's internal ID.
Check the browser network panel for failed embed.js requests. Clear page caches
after changing settings. Exclude FinchSend's loader and embed script from plugins
that delay, combine, relocate or rewrite JavaScript. Themes must call wp_footer.
For strict Content Security Policy, permit the configured FinchSend origin for
script-src and connect-src and the embed's inline styles in style-src.
HTTP local origins are intentionally unsupported; use HTTPS for staging too.

== Changelog ==

= 1.0.0 =
Settings in Polish/English, inline shortcodes, optional site-wide pop-up,
deduplication, load error messages, existing FinchSend double opt-in flow.
