Integrations · E-commerce

Validate emails in PrestaShop

The email-validation.org module for PrestaShop checks the email address a customer types when they create an account, at the checkout's personal information step, when they change their address, when they sign up for the newsletter and when they send the contact form. Addresses that cannot receive email and throwaway inboxes are refused with one plain message; at the checkout, by default, only addresses that cannot receive email. When our API cannot answer, the customer goes on: no order is ever lost to our side.

The module is not on PrestaShop Addons yet: you install it from the zip on this page.

Before you start

  • An API key from the API keys page. The default permission, "Validate addresses", is enough. A daily credit cap limits what a busy shop can spend.
  • PrestaShop 8.0 to 8.2 or 9.0 to 9.2, with the PHP version that release supports. The module needs nothing beyond PrestaShop itself.

Install

  1. Download emailvalidationorg.zip. It holds one folder, emailvalidationorg/, with the module's files and its MIT licence, built from the module's tested source. SHA-256: bc973801617abc339cb4919f7fef75185c3476d1cc5e7a90ce1847cfee6bff96.
  2. In the back office, open Modules → Module Manager and click Upload a module at the top of the page. Pick the zip, then open the module's Configure page. (Unzipping it into your shop's modules/ folder and installing it from the modules page does the same.)
  3. On the Configure page, paste your key in API key and click Save. Saving checks it once with a free test address: "The key works" means it is ready. The key is stored encrypted with your shop's own key, and the field stays empty on the page.
  4. Pick the region (US, or EU to have addresses validated in the EU and their results stored there), the answers to refuse and the forms to check. The defaults refuse invalid and disposable addresses, and only invalid ones at the checkout.

Keep the key out of the database: set it in your PHP-FPM pool as env[EMAIL_VALIDATION_ORG_API_KEY] = … instead. It then wins over a stored key, and the Configure page says which one is in use.

Try it

Once the Configure page has said the key works, with the account-creation check on and invalid among the refused answers (both are the defaults), open your shop's registration page and create an account with no_mailbox@sandbox.email-validation.org. The message appears under the email field, and nothing is saved or mailed. Addresses on sandbox.email-validation.org give each answer for free: disposable@… is refused by default too, while catch_all@… passes unless you tick Catch-all among the refused answers.

Never try it with an address that passes (such as accepted@…): PrestaShop would make the account and may mail it. If any of the three conditions above is in doubt, turn your shop's outgoing mail off for the test.

What is checked

FormWhenDefault
Account creationevery new accounton
Checkout, personal information stepa guest, or an account made during the checkouton, invalid only
The customer's "Information" pageonly when the address changeson
Newsletter sign-up (the email subscription block)a sign-up, never an unsubscriptionon
Contact form (the contactform module 4.4.3 or newer)a message the contact form would sendon

Each form has its own switch on the Configure page. There are two lists of refused answers: one for the checkout and one for every other form. You can refuse invalid, disposable, catch_all and unknown; a valid address is never refused. See what each status means.

What customers see when an address is refused, whatever the reason (you can translate it under International → Translations):

This email address cannot be used. Please check it for typos or use another address.

On the customer forms it is under the email field, with the form as they filled it, so they can correct the address and go on.

No order is refused or cancelled

The checkout check is on the first step, before the addresses, the shipping and the payment. Nothing in the module runs on the payment step or when the order is validated, so it never refuses or cancels an order. A customer who reached the payment step is never stopped by it.

The module sends nothing while the form has another error, so a submission PrestaShop refuses anyway is not checked. The same address sent again within the hour, after another field was fixed, is not checked again once it has a finished answer; an unknown answer is asked again.

If a check cannot finish

A timeout, no connection, no credits, a refused key or our API out of reach: the address passes, and one line starting email-validation.org: is written to Advanced Parameters → Logs, with the reason, our error code and our request id, never the address or the key. Look up the error code on the errors page.

  • "The key was saved, but our API refused it" on the Configure page: copy the whole key again from the API keys page and check it has the "Validate addresses" permission. A key with a space or a line break is refused on the page.
  • "The key was saved, but the test check did not finish": addresses pass unchecked until a check finishes. Save again in a minute; if it keeps saying so, the status page shows whether our API is up.
  • "A key is stored but cannot be decrypted": your shop's app/config/parameters.php was moved or restored with a new cookie key. Type the key again.
  • Too many checks from one visitor: by default, a visitor gets 20 checks an hour (setting "Checks per visitor per hour"; 0 turns the limit off). Over it, the address passes unchecked and a log line says so. The visitor is the address PrestaShop sees, and behind a proxy that depends on the release:
    • Behind a reverse proxy on a private address, PrestaShop reads X-Forwarded-For. PrestaShop 8.0, 8.1, 8.2.0 to 8.2.7, 9.0 and 9.1.0 to 9.1.4 use its first entry. A visitor can set that entry, so there the limit holds only when your proxy replaces the header instead of adding to it. PrestaShop 8.2.8 or newer, 9.1.5 or newer and 9.2 use its right-most public entry.
    • Behind a CDN, restore the visitor's address on the server (for example with your web server's real-IP module), or every visitor counts as one and checks stop after the limit for everyone.
    • The daily credit cap on the key is the ceiling that always holds.
  • The contact form is not checked: update the contactform module to 4.4.3 or newer (PrestaShop 8.0 and 8.1 shipped older ones).

What is not checked

Customers made or edited in the back office, through the webservice or by an import; checkout and account modules that do not use PrestaShop's own customer form, including PrestaShop 9.2's optional one-page checkout module; and contact forms of other modules.

Your existing customers: export them from Customers → Customers (the Export button at the top) and upload the file to the bulk check in your account.

Privacy

The key is sent only to our API, in the Authorization header, and is never in a log line, a message or a page. The module never logs an address. To avoid charging a resubmitted form twice and to count each visitor's checks, its own table keeps, for an hour, only a keyed hash of the address and of the visitor's IP address, with the answer's status, reason and disposable flag. The module sends no mail.

Uninstalling the module removes its settings, the stored key and its table.

More on PrestaShop

Updated · Maintained by: Email Validation LLC

Need help? Contact support, or ask the help chat. Something wrong or missing on this page? Tell us