Integrations · Frameworks and SDKs

Validate emails of PandaDoc recipients

Check a PandaDoc document's recipients before you create it. One module with no dependencies, called by your own server right before it creates a document through PandaDoc's API: it checks the address of every recipient and tells you which ones cannot receive mail and where they sit in the request, so a mistyped address is fixed before the document goes out. It never changes the request and never calls PandaDoc.

Download it: email-validation-pandadoc.zip holds email-validation-pandadoc.mjs (one JavaScript module) and the MIT licence.

What you need

  • An API key of ours from the API keys page with Validate addresses (on by default). Keep it on your server, never in a page.
  • Your server's code that creates documents, in anything with fetch (Node 22 or later, Bun, Deno, Cloudflare Workers). Copy email-validation-pandadoc.mjs next to it.
  • No PandaDoc key: the module reads the request you are about to send and nothing else.

Before you create a document

PandaDoc takes the recipients when you create the document; its Send document call has none. So check the body of Create document (POST https://api.pandadoc.com/public/v1/documents). Make the check once per process, not per document: it remembers answers between documents.

import { createPandaDocCheck } from './email-validation-pandadoc.mjs';

const ev = createPandaDocCheck({ apiKey: process.env.EV_API_KEY });

const body = {
  name: 'Proposal for Acme',
  template_uuid: templateId,
  recipients: [
    { email: customer.email, first_name: customer.firstName, last_name: customer.lastName, role: 'Client' },
    { email: 'sales@acme.example', first_name: 'Sales' },
  ],
};

const report = await ev.checkDocument(body);
if (!report.ok) {
  // report.blocked: e.g. [{ where: 'recipients[0].email', status: 'invalid', reason: 'no_mailbox', … }]
  // ask for the address again instead of creating the document
} else {
  // create the document with PandaDoc as you do today, then send it
}

Each entry of report.results holds a recipient's email, where, status, reason, action, did_you_mean, blocked and, when it got no answer, error.

What it checks

  • The email of each entry in recipients.
  • For a recipient group ("type": "recipient_group"), the email of each of its members.
  • A recipient with only a phone has no address and is not checked.

The same address listed twice is checked once.

Try it free first

Check one of our free test addresses (on a domain that receives no mail) without creating anything:

const report = await ev.checkDocument({
  recipients: [{ email: 'no_mailbox@sandbox.email-validation.org', first_name: 'Test', role: 'Client' }],
});
console.log(report.ok, report.blocked); // false [ { where: 'recipients[0].email', status: 'invalid', … } ]

Checks of our test addresses are free. Never send a real document to them, or to any address you made up: the email would bounce.

How it decides

  • What is blocked. invalid by default. block: ['invalid', 'disposable'] also blocks disposable addresses, and catch_all can be added too. valid and unknown are never blocked: act on the action of a valid result if you want to (spam traps and known complainers are valid with the action remove).
  • It fails open. A timeout (6 seconds per check by default, timeoutMs), a network error, a rate limit, no credits or any error answer leaves that recipient unchecked (error says why) and never blocks it. Nothing is retried; after a rate limit the module sends nothing until our API's Retry-After has passed. A missing apiKey throws when you make the check, so a setup mistake does not pass every document unchecked.
  • Answers are remembered. A verdict is kept for the process's life (10,000 addresses by default, memoMaxEntries), so the next document to the same person costs nothing; an unknown or a failed check is asked again.
  • Credits. Each check uses one credit (unknown results, malformed and sandbox addresses are free). region: 'eu' checks in the EU, at https://api-eu.email-validation.org.
  • Our key goes only to our API, redirects are never followed, and the module logs nothing.

Test it first

The module reads the request's fields by the names of PandaDoc's API reference and has not run against a real PandaDoc account. A request built in another shape is not understood, and its recipients are then not checked. Run it with the test address above before you rely on it.

More on PandaDoc

Updated · Maintained by: Email Validation LLC

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