=== RadarAddress – Fake and Mistyped Email Check for Ninja Forms ===
Contributors: radarwave
Tags: ninja forms, email validation, fake email, disposable email, address autocomplete
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.1
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Reply to every message: typos like gmial.com corrected, fake and disposable emails flagged in every Ninja Forms form. Just paste a token.

== Description ==

A visitor writes to you, you answer, and the reply bounces: the email was mistyped, or it was a throwaway address. The message is lost and so is the contact.

RadarAddress checks the email address of every submission of every Ninja Forms form, with nothing to configure beyond the API token: an unmistakable typo in the domain (gmial.com, hotmal.com…) is corrected and you receive the reply address that works, with the original kept; an address that cannot receive mail (a domain that does not exist, a disposable mailbox) is flagged, and refused with a message under the field only if you switch that on. The visitor who made a typo reads the corrected address in the confirmation message.

Phone numbers are verified too (one light check per number; the number that goes with the verification of the address uses none): valid, to check or invalid, with the number in international form next to it. The Phone fields of every form work on their own, and a prefix menu next to them is set to the country of the address: the form receives the number with the prefix in front, and the number as typed is never rewritten.

The Address, City, Zip and Country fields of Ninja Forms work on their own: the street completes while the visitor types, postcode and city fill in, and on submission the address is verified against the national register. Other fields, plain text fields or no address at all can be chosen for each form in Ninja Forms → RadarAddress. The address never blocks a submission and the fields of the visitor are never rewritten.

Where the outcomes go: saved with the entry, listed in the page of the form, in the export, at the end of the notification emails (not the ones sent to the visitor), and in the merge tags `{radaraddress:email_outcome}`, `{radaraddress:email_original}`, `{radaraddress:email_suggestion}`, `{radaraddress:outcome}`, `{radaraddress:address}`, `{radaraddress:reason}`, `{radaraddress:phone_outcome}` and `{radaraddress:phone_international}`.

**What you get**

* Every email field of every form verified: syntax, domain that receives mail, disposable mailbox, role address (info@, office@…), unmistakable typo corrected.
* The corrected address wherever the email is used: the Reply-To of the notifications and the notifications sent to the visitor.
* Address autocomplete and correction on the Address field, or on the text fields you map, in the countries where the national address register is in service.
* Verification of the address on submission, with the verified form and the reason.
* Verification of the phone number on submission, with the number in international form, and a prefix menu next to the Phone field.
* Entries already received verified in bulk from the page of the form: you choose which ones, in which order and how many.
* The outcomes in the export, and in three columns of the classic submissions list.
* Verification precision from strict to maximum: how far RadarAddress goes to find an address written badly.
* Typo correction level (1-3) for the email domain, and a «Did you mean …?» question on the field instead of a correction you did not choose.
* Fail-open by design: if RadarAddress does not answer, the submission goes through as usual.
* Data stays in the EU. Sources: the national address registers, published as open data.

**How it works**

1. Create a free account on radaraddress.com (every month 500 light checks and 50 contact checks are free).
2. Create an API token in your personal area.
3. Ninja Forms → RadarAddress: paste the token and press «Verify and save». The emails and the Address fields are verified from now on; for text fields, map them in the page of the form, in Ninja Forms → RadarAddress.

One light check is used per email and per phone number verified; one contact check per address verified (typing is free; a selection from the suggestions and the verification of the same address count once). For most sites the free checks of the month are all they need; beyond that, packs and monthly subscriptions on radaraddress.com.

**Third-party service**

This plugin sends the email address, the phone number and, in the forms with an Address field or mapped fields, the address typed in the form to the RadarAddress API (https://www.radaraddress.com) to get verification results and suggestions. Terms: https://www.radaraddress.com/en/terms — Privacy: https://www.radaraddress.com/en/privacy-policy.php

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install the zip from Plugins → Add New → Upload.
2. Activate it. Ninja Forms 3.16 or later is required.
3. Ninja Forms → RadarAddress: paste your API token and press «Verify and save».
4. Optional: Ninja Forms → RadarAddress, the page of a form, to choose other fields, the text fields that hold the address, or no address at all.

== Frequently Asked Questions ==

= Does it block the submission? =

Never for the address or the phone number. For the email only if you switch it on: then an address that cannot receive mail, or a role address, is refused with a message under the field, like any other validation error of Ninja Forms.

= Do I have to configure the fields? =

No: every email field of every form is verified, and the Address, City, Zip and Country fields are used on their own. Only if the address is in text fields: Ninja Forms → RadarAddress, the page of the form, five menus.

= Where do I see the outcome? =

In the page of the form, in the export, and at the end of the notification emails you receive, as a short block. If you prefer a precise place, use the merge tags listed in the settings.

= Can I verify the entries I have already received? =

Yes: in Ninja Forms → RadarAddress, the page of the form, you choose which entries, in which order and how many. The outcomes are written in the entry; the email as it was written never changes.

= Does it change what the visitor wrote? =

The address fields, never: you receive what was typed and, next to it, the verified form. The email, only for an unmistakable typo in the domain and only if the option is on: the corrected address replaces the original where it is used (the reply address, the emails to the visitor), the original is kept in the notification and in the entry, and the visitor reads the corrected address in the confirmation message.

= How much does it cost? =

The plugin is free. One light check per email or phone number verified, one contact check per address verified. Every month the first 500 light checks and 50 contact checks are free. Beyond that, packs and monthly subscriptions on radaraddress.com.

= What if RadarAddress is down? =

The submission goes through as usual, with no message to the visitor; the notification says «not verified».

== External services ==

This plugin connects to the RadarAddress API, a service run by RadarWave (the author of this plugin), to verify email addresses and phone numbers and to suggest and verify postal addresses. It does nothing until you paste your own API token in Ninja Forms → RadarAddress.

* **What is sent and when:** when a form is submitted, the email address typed in the email fields and the phone number typed in the Phone fields (with the country of the form) are sent to be verified; in the forms with an Address field or mapped fields, the address typed (street, house number, postcode, city, province, country) is sent while the visitor types, to get suggestions, and on submission, to be verified. Your API token is sent with every request to identify your account. With each check the plugin also sends the address of the page that holds the form (without its query string) and the form and field it came from, so you can find it in your account's log. The settings page also asks the API for your account's remaining checks.
* **Where:** https://www.radaraddress.com/api/v1/ (calls are made by your site's server, or through the plugin's own REST endpoint on your site: the token never reaches the browser).
* **Terms of use:** https://www.radaraddress.com/en/terms
* **Privacy policy:** https://www.radaraddress.com/en/privacy-policy

== Screenshots ==

1. The page of the form: which fields hold the address, the entries to verify and the latest outcomes.
2. The form: the street completes while the visitor types, with the register source at the bottom of the popup.
3. The settings in Ninja Forms → RadarAddress: token, email and address switches.

== Changelog ==

= 1.2.0 =
* When the plugin verifies the address of a submission, the first phone number goes with it in one request: the contact verification includes it, so it no longer uses a light check of your account.

= 1.1.0 =
* Phone numbers verified on every submission: valid, to check or invalid, with the number in international form saved with the entry, in the page of the form, in the export, in the notification emails and in two new merge tags. The entries already received are verified too.
* A prefix menu next to the Phone field, set to the country of the address: the form receives the number with the prefix in front. The number as typed is never rewritten; a Phone field with an input mask keeps it and gets no menu.
* Two new switches in Ninja Forms → RadarAddress.

= 1.0.1 =
* Bulk verification: the button to verify only the entries your credit covers has the WordPress look.

= 1.0.0 =
* First release: email verification on every submission (typos corrected, addresses that cannot receive mail flagged or refused, «Did you mean …?» on the field), address autocomplete and verification in the Address fields or in the text fields you map, outcomes in the page of the form, in the export, in the notification emails and in merge tags, bulk verification of the entries already received.
