=== SubmitRelay ===
Contributors: muzaffarpakhtoon
Tags: contact form, shortcode, popup, email, whatsapp
Requires at least: 5.0
Tested up to: 7.1
Requires PHP: 7.2
Stable tag: 1.1.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WordPress contact form with floating popup, shortcode, email, SMTP, enquiry storage, and customizable pre-filled WhatsApp messages.

== Description ==

**SubmitRelay** is a WordPress contact form plugin for collecting customer enquiries, saving submissions in WordPress, sending email notifications, and optionally continuing conversations through WhatsApp.

Create a contact form that works as a **floating popup** or as a standalone form using the `[submitrelay_form]` shortcode.

SubmitRelay is useful for hotels, houseboats, travel businesses, tours, booking enquiries, local services, agencies, freelancers, support requests, quotation forms, and small businesses.

### Contact Form + WhatsApp

Connect your WordPress contact form with WhatsApp using a customizable message template.

After a successful form submission, SubmitRelay can open WhatsApp with a **pre-filled message containing information submitted by the visitor**.

Use built-in placeholders such as:

* `{name}` — Customer name
* `{email}` — Customer email
* `{phone}` — Customer phone number
* `{message}` — Customer message
* `{page_url}` — Page where the form was submitted
* `{site_title}` — Website title
* `{site_url}` — Website URL

Custom form fields can also be used as WhatsApp placeholders. For example, if a custom field has the ID `travel_date`, you can use `{travel_date}` in the WhatsApp message template.

This lets site owners create messages tailored to their business, such as booking dates, guest details, travel requirements, service requests, or other custom enquiry information.

### Save Customer Enquiries

SubmitRelay can save form submissions directly inside WordPress.

Administrators can view, search, export, and delete saved submissions. Stored information can include:

* Name
* Email
* Phone number
* Message
* Custom form fields
* Submission date and time
* IP address when IP storage is explicitly enabled

### Email Notifications and SMTP

SubmitRelay sends email notifications using WordPress `wp_mail()` by default.

For websites that require SMTP delivery, SubmitRelay also provides optional SMTP configuration using WordPress's bundled PHPMailer.

### Floating Popup or Shortcode Form

Display your form as:

* A floating popup
* A standalone form using `[submitrelay_form]`

The shortcode can be used on pages, posts, widgets, and supported theme template locations.

### Key Features

* Floating popup contact form with configurable position, animation, visibility, and schedule.
* Standalone `[submitrelay_form]` shortcode.
* Configurable Name, Email, Phone/WhatsApp, Message, and custom fields.
* Customizable pre-filled WhatsApp message templates.
* Built-in placeholders for submitted form information.
* Custom form field placeholders for WhatsApp messages.
* Email notifications through WordPress `wp_mail()`.
* Optional SMTP configuration.
* Optional WhatsApp redirect after successful submission.
* Submission storage inside WordPress.
* Administrator screen for viewing, searching, exporting, and deleting submissions.
* WordPress personal-data exporter and eraser integration.
* Optional GDPR consent checkbox and configurable privacy-policy URL.
* IP address storage disabled by default.
* Settings export/import with SMTP passwords excluded from exports.
* Basic anti-spam honeypot and short-term request rate limiting.
* Unified Floating Button appearance controls.
* No advertising, analytics, telemetry, or remote tracking.

### Why SubmitRelay?

SubmitRelay combines several common customer-contact requirements in one WordPress plugin:

**Contact Form → Save Enquiry → Email Notification → Pre-filled WhatsApp**

Instead of relying on separate tools for every part of the enquiry process, site owners can collect customer information, keep a record of submissions, receive email notifications, and optionally start a WhatsApp conversation using a prepared message.

== Live Demo ==

See SubmitRelay in action on a live travel and booking website:

https://www.houseboatsinsrinagar.com/

The live site demonstrates SubmitRelay in a real travel and booking environment.

== Privacy and Data Collection ==

When a visitor submits the form, SubmitRelay can store the form fields configured by the site administrator, including name, email, phone number, message, custom fields, and submission date/time.

IP address storage is an administrator-controlled option and is disabled by default. When enabled, the visitor IP address is stored with the submission and may also appear in notification emails and CSV exports.

The plugin provides WordPress privacy exporter and eraser integrations for stored submissions associated with an email address.

Site administrators are responsible for configuring the plugin in accordance with their applicable privacy, data-protection, retention, and consent requirements. Enabling the GDPR checkbox does not by itself make a site compliant with any particular law.

== External Services ==

SubmitRelay can optionally interact with the following external services, only when the corresponding feature is used or configured:

* WhatsApp: when WhatsApp redirect is enabled, the browser is redirected to a `wa.me` URL containing the configured WhatsApp number and the generated message content based on the site's configured message template. WhatsApp's own terms and privacy practices apply.
* SMTP provider: when SMTP is enabled, email content and recipient information are sent through the SMTP server configured by the site administrator. The provider's terms and privacy practices apply.

The plugin does not make background tracking or telemetry requests to these services.

== Installation ==

1. Upload the `submitrelay` folder to `/wp-content/plugins/`, or install the plugin ZIP from **Plugins > Add New Plugin > Upload Plugin**.
2. Activate **SubmitRelay** from the Plugins screen.
3. Open the SubmitRelay settings page and configure the form, popup, email, privacy, and optional WhatsApp/SMTP settings.
4. The floating popup can be enabled from the plugin settings.
5. To display a standalone form, add `[submitrelay_form]` to a page, post, widget, or supported template location.

== Frequently Asked Questions ==

= Does SubmitRelay require an external service? =

No. Email delivery uses WordPress `wp_mail()` by default. SMTP and WhatsApp are optional.

= Can I use SubmitRelay without WhatsApp? =

Yes. WhatsApp integration is optional and can be enabled or disabled from the plugin settings.

= Can I customize the WhatsApp message? =

Yes. You can configure a WhatsApp message template and use supported placeholders to insert submitted information.

= Can custom form fields be included in the WhatsApp message? =

Yes. Custom form fields can be referenced using their field IDs as placeholders in the WhatsApp message template.

For example, a custom field with the ID `travel_date` can be inserted using:

`{travel_date}`

= Does SubmitRelay save form submissions? =

Yes. When submission storage is enabled, submissions can be viewed, searched, exported, and deleted from the WordPress administration area.

= Does the plugin store IP addresses? =

Not by default. IP address storage is disabled by default and can be enabled in the GDPR/privacy settings. A visitor IP may still be used temporarily for rate limiting, but it is not stored unless IP storage is enabled.

= How does WhatsApp redirect work on mobile? =

After a successful form submission, SubmitRelay shows the success/redirect message briefly and then opens the configured `wa.me` link. On phones and tablets, it uses the current page so supported devices can hand the link off to the installed WhatsApp app instead of opening a new browser tab. On desktop, the New Tab option keeps the website open.

= Does the plugin send data to WhatsApp? =

Only when the site administrator enables the WhatsApp redirect feature. The browser is redirected to WhatsApp with the configured message content after submission.

= Are SMTP passwords included in settings exports? =

No. SMTP passwords are deliberately excluded from exported settings.

= How are stored submissions removed? =

Administrators can delete submissions from the SubmitRelay submissions screen. WordPress's Privacy Tools can also use the plugin's personal-data eraser integration.

= Does SubmitRelay include analytics or tracking? =

No. The plugin does not include advertising, analytics, telemetry, or background tracking requests.

== Screenshots ==

1. SubmitRelay floating popup contact form.
2. SubmitRelay form and floating button settings.
3. SubmitRelay WhatsApp message template settings.
4. SubmitRelay saved submissions management.
5. SubmitRelay email and SMTP settings.

== Changelog ==

= 1.1.6 =

* Changed Floating Button vertical control to a simple non-negative Bottom Offset (0–200 px).
* Positive values move bottom-positioned floating buttons higher; negative values are no longer supported.

= 1.1.5 =

* Hardened settings sanitization and runtime validation for all user-configurable values.
* Removed HTML handling from the floating button icon setting; icons are stored as text/emoji.
* Added strict bounds and allowlists for numeric, color, position, date/time, URL, and other settings used in generated output.
* Ensured settings are normalized before generating CSS, JavaScript, and HTML.
* No arbitrary custom CSS, JavaScript, or PHP insertion is supported.

= 1.1.4 =

* Added a controlled Vertical Offset setting for the floating button.
* Allows site owners to move the floating button up or down within a safe 200-pixel range.
* The adjustment is implemented as a sanitized numeric setting and generated by the plugin; no arbitrary CSS is accepted.

= 1.1.3 =

* Added strict phone-number validation on both the browser and server.
* Phone fields accept 7-15 digits with common formatting characters (spaces, +, -, parentheses and periods) and reject letters or arbitrary text.
* Added `inputmode=tel`, a length limit, and a validation pattern to phone inputs.

= 1.1.2 =

* Unified the floating button appearance settings into one Floating Button section.
* Renamed Button Color to Floating Button Color.
* Floating Button Color now controls both the floating button and submit button backgrounds.
* Text/Icon Color now controls floating button text/icon, submit button text, and the popup close icon.
* The popup close button is always available when the popup is open.
* Added strict phone-number validation to reject arbitrary text and accept common phone formatting characters.

= 1.1.0 =

* Removed unrestricted custom CSS input and unrestricted CSS design-value fields.
* Fixed popup and button sizing, padding, border radius, and close-button size to controlled plugin defaults.
* Removed legacy storage of unrestricted CSS design values from active settings.

= 1.0.9 =

* Removed the arbitrary Additional CSS setting to comply with WordPress.org plugin review requirements.
* Preserved controlled design options such as popup, button, field, placeholder, overlay, and mobile button colors/positions.
* Updated the settings export version to 1.0.9.

= 1.0.8 =

* Improved WordPress.org compatibility by using WordPress enqueue APIs for JavaScript and CSS output.
* Prefixed plugin runtime hooks, storage identifiers, and names to reduce collisions.
* Preserved existing settings, submissions, popup, standalone form, email, SMTP, GDPR, scheduling, and WhatsApp behavior.

== Upgrade Notice ==

= 1.1.6 =
Updated floating button positioning with a simpler Bottom Offset control from 0–200 pixels.

= 1.0.9 =
Removed arbitrary custom CSS input while keeping the built-in design and color controls.

= 1.0.8 =
Improved WordPress.org compatibility and naming isolation while preserving the existing popup, standalone form, email, SMTP, GDPR, scheduling, submissions, and optional WhatsApp behavior.
