=== LeadSender Forms ===
Contributors: prohortech
Tags: contact form, form builder, forms, gdpr, leads
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Drag-and-drop contact form builder with a personal data consent checkbox, email notifications and a list of submissions.

== Description ==

In Russian the plugin is called «Формы с отправкой заявок» ("Forms that deliver leads").

LeadSender Forms is a lightweight form builder for business websites. Build a callback or contact form in a few clicks, put it on any page and receive every submission by email and in the WordPress admin.

The plugin is made for Russian websites and follows the Russian personal data law (152-FZ): every new form already contains a consent checkbox with a link to your privacy policy, the checkbox is never pre-checked, and each submission stores the consent text and the time it was given.

= Form builder =

* Three-column builder: field palette, the form as it looks on the site, settings of the selected field.
* Add fields by drag and drop or by click; reorder by dragging or with the arrow keys.
* Duplicate and delete fields, undo the last change (Ctrl+Z), save with Ctrl+S.
* Warning when you leave the page with unsaved changes or remove the consent field.
* Built with the WordPress packages (wp-element, wp-components). No external libraries or CDNs.

= Fields =

* Name
* Phone with the +7 mask; numbers are stored as +7XXXXXXXXXX
* Email
* Single line text
* Paragraph text
* Dropdown
* Checkboxes / radio buttons
* Personal data consent
* Text / heading inside the form

Every check that runs in the browser is repeated on the server.

= On the site =

* Shortcode `[leadsender_form id=5]` and the "LeadSender Forms" block for the block editor.
* Plain HTML form without jQuery. The script and styles load only on pages that contain a form.
* Submits without reloading the page and still works with JavaScript disabled.
* Several forms on one page do not interfere with each other.
* After submission show a message or redirect to a "Thank you" page.

= Submissions =

* Each submission is saved to the database first and only then sent, so it is never lost when email fails.
* Email to the site administrator via wp_mail (works with any SMTP plugin), Reply-To set to the client's email.
* If the email is not sent, the plugin retries in 1, 5 and 30 minutes and shows the delivery status in the submission card; you can resend it manually.
* List of submissions with a new submissions counter in the menu, read/unread marks and deletion.
* Sequential submission numbers (No. 1024) in emails and in the list.

= Spam protection without third-party services =

* Hidden honeypot field.
* Minimum time to fill in the form (signed timestamp). The timestamp is requested by a separate REST call, so the protection works on pages cached by caching plugins.

= Personal data =

* Consent checkbox with a link to the privacy policy page selected in Settings → Privacy.
* Optional automatic deletion of submissions older than N days.
* Export and erase submissions with the standard WordPress tools (Tools → Export / Erase Personal Data).
* Suggested text for your privacy policy.
* IP addresses are stored only as a salted hash.

= Works with other wp-addon.ru plugins =

* «Согласно» (Soglasno): the consent text is taken from it and every consent is written to its log.
* «Отправка форм в MAX» (LeadSender for MAX): LeadSender Forms appears in its list of sources. Each submission reaches MAX exactly once — the notification email is marked so the "any form via wp_mail" source does not send a duplicate.

= Pro version =

LeadSender Forms Pro is a separate add-on sold on [wp-addon.ru](https://wp-addon.ru/leadsender-forms/). It adds photo and file uploads, delivery to MAX, Telegram and prohor.tech CRM, captchas, conditional logic, multi-step forms, columns, CSV export and migration from Fluent Forms. The free plugin is fully functional without it and contains no locked features.

== Installation ==

1. Install the plugin from the WordPress plugin directory or upload the ZIP in Plugins → Add New → Upload Plugin.
2. Activate it. A sample "Callback" form is created on the first activation.
3. Open WP-ADDON → Forms, edit the form and copy its shortcode, or add the "LeadSender Forms" block to a page.
4. Select your privacy policy page in Settings → Privacy so the consent checkbox links to it.

== Frequently Asked Questions ==

= Where do the emails go? =

To the address set in WP-ADDON → Forms → Settings, or to the site administrator's email if it is empty. Each form can have its own address on the "Notifications" tab.

= Emails do not arrive. What should I do? =

The plugin sends email through wp_mail, like WordPress itself. Install any SMTP plugin and configure it. Submissions are saved in WP-ADDON → Forms → Submissions anyway, and failed emails can be resent from the submission card.

= Does the form work with page caching? =

Yes. The spam protection key is requested by a separate uncached REST call right before the form is used, so cached pages keep working.

= How do I track submissions in Yandex Metrica or Google Analytics? =

Either redirect to a "Thank you" page after submission (the "After submission" tab) or listen to the `lsff:success` event:

`document.addEventListener( 'lsff:success', function ( e ) { ym( 12345678, 'reachGoal', 'lead' ); } );`

`e.detail.formId` and `e.detail.number` contain the form ID and the submission number.

= Can I remove the consent checkbox? =

Yes, but the builder will warn you: a form that collects names, phones or emails without consent violates the Russian personal data law.

= Does the plugin connect to external services? =

No. The free version does not send data to any third-party service. Emails are sent by your own site through wp_mail.

= For developers =

Hooks: `lsff/field_types`, `lsff/form_tabs`, `lsff/form_tab`, `lsff/validate_submission`, `lsff/entry_saved`, `lsff/email_args`, `lsff/entry_columns`, `lsff/entry_actions`, `lsff/form_render_attrs`, `lsff/admin_tabs`, `lsff/delivery_handlers`. Builder extension points (wp.hooks): `lsff.fieldSettings`, `lsff.fieldPreview`, `lsff.formTabs`, `lsff.renderTab`.

The JavaScript files in `assets/js` are the original source code; there is no build step.

== Screenshots ==

1. Form builder: field palette, form preview and field settings.
2. Form on the site.
3. List of submissions.
4. Submission card with consent details and delivery status.

== Changelog ==

= 1.0.4 =
* The submit button keeps its colors when the theme resets button styles (for example, Hello Elementor reset.css).
* Text / heading block: color, font size and alignment; inline <span style> is allowed.
* Link color setting for the consent text and text blocks.

= 1.0.3 =
* Extension points for add-ons: field wrappers on the site, filters above the submissions list, badges in the builder.

= 1.0.2 =
* Extension points for importing submissions from other form plugins (original submission dates are kept).

= 1.0.1 =
* Notifications are sent after the visitor gets the response, so the form answers instantly.
* Extension points for add-ons: extra submission data, custom field validation in the browser, the lsff:beforesubmit event.

= 1.0.0 =
* First release.
