=== Email Validation for Gravity Forms (email-validation.org) ===
Tags: email validation, email verification, gravity forms, entries, bulk
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.0.1
License: MIT
License URI: https://opensource.org/licenses/MIT

Check the email addresses in the entries your Gravity Forms forms already have, and choose per form which results stop a submission.

== Description ==

An add-on to **email-validation.org – Email Validation for Forms**, which checks the email field of every Gravity Forms form when it is submitted, with one set of rules for all forms. This add-on adds what that plugin leaves out:

**Forms → Check entry addresses** checks the email field you pick in the entries one form already has, as one bulk list with the [email-validation.org](https://email-validation.org/) API, and keeps each result on its entry. The form's Entries list gets an **Email check** column and filter.

**Form Settings → Email validation (email-validation.org)** lets each form follow the main plugin's settings (the default), use its own statuses and message, or not be checked at all.

Every result is one of five statuses: `valid`, `invalid`, `catch_all`, `unknown` or `disposable`.

* **Asks before it spends.** The form's entries are counted on your site first (nothing is sent); you confirm at most one credit per entry. Each distinct address is charged once, entries without an address and entries sent after the count cost nothing, and the list is started only if it needs no more than you confirmed.
* **Runs in the background** in small batches (WP-Cron), so you can close the page; it survives a PHP time limit and is never uploaded or started twice by itself. Cancel at any time: unused credits come back.
* **Changes nothing but the result.** The status, reason and date are kept as entry meta. No entry is deleted or edited, and no email is sent.
* **Checked again only when needed.** A second check leaves out entries whose address already has a result, unless you ask to check them again.
* **Per-form rules without a second charge.** A form with its own rules is checked once, through the main plugin's checker; a form turned off, or one with its own rules and no status ticked, is not checked or charged at all.
* **Your API key stays where the main plugin keeps it.** This add-on has no key field of its own and never shows, logs or sends the key anywhere but to the API.

= Requirements =

* Gravity Forms 2.5 or later.
* email-validation.org – Email Validation for Forms 1.1.2 or later, with an API key that has the **Bulk lists** permission for the entry check.

== Installation ==

1. Install and activate Gravity Forms and email-validation.org – Email Validation for Forms, and set your API key under Settings → Email validation.
2. Install and activate this add-on.
3. To check existing entries: go to Forms → Check entry addresses, pick the form and its email field, press **Count the entries**, tick the box with the credits shown and press **Check the entries**.
4. To give a form its own rules: open the form, Settings → Form Settings → Email validation (email-validation.org).

== Frequently Asked Questions ==

= Is every submission checked twice now? =

No. A form that follows the main plugin is checked by the main plugin only. A form with its own rules is checked by this add-on only, through the main plugin's checker. A form turned off is not checked.

= What happens when the API is slow or out of reach? =

The main plugin's setting decides, for forms with their own rules too: by default the form goes through. The check waits at most 10 seconds and is never retried.

= Does it delete entries with a bad address? =

No. It only keeps the result on the entry. You decide what to do with it.

= What does it log? =

Counts, the job id and error codes, in Gravity Forms' own log when you turned logging on (Forms → Settings → Logging). Never an address or the key.

= Does it store the addresses? =

Only while a check needs them: the list and the results are private files in your uploads folder, deleted after the upload and after the results are saved (a list that could not be sent is kept until you press Try again or Discard). The result on an entry holds the status, the reason, the date, the field and a hash of the address it belongs to.

= What happens when I uninstall it? =

A check that is still running is cancelled (unused credits come back), and the check's own data (its progress, files and scheduled task) is removed. The results stay on your entries as entry meta, and each form's rules stay in its settings (ignored without the add-on).

== External services ==

This add-on sends email addresses to the email-validation.org API to check them:

* **What is sent:** for the entry check, a list of the addresses in the email field you picked, each with a reference made of the entry's id (`e123`); for a form with its own rules, the address submitted in its email field. Your API key goes in the request header. Nothing else about the entry or the visitor.
* **When:** when you confirm a check on Forms → Check entry addresses (then the add-on also asks for the list's progress, starts it and downloads its results), when that screen shows your balance, and when a visitor submits a form with its own rules.
* **Where:** `https://api.email-validation.org`, or `https://api-eu.email-validation.org` when EU data residency is chosen in email-validation.org – Email Validation for Forms.

The service is provided by email-validation.org: [Terms of Service](https://email-validation.org/legal/terms/), [Privacy Policy](https://email-validation.org/legal/privacy/).

== Changelog ==

= 1.0.1 =

* Needs email-validation.org – Email Validation for Forms 1.1.2 or later, which never hands back a value that quotes the API key.
* The main plugin is named by its new name, email-validation.org – Email Validation for Forms.
* Forms → Check entry addresses on PHP 8.1 and 8.2: the list's size is read from the open file, never from PHP's stat cache.

= 1.0.0 =

* First release: Forms → Check entry addresses, results as entry meta with an Email check column, per-form rules in Form Settings.
