Integrations · Forms

Validate your BDOW! (Sumo) subscribers

Check the email address of each new subscriber of your BDOW! pop-ups and forms (BDOW! is the list-building tool that was called Sumo). BDOW! calls a small receiver on your own server after each subscription; the receiver checks the address and tells your code the result, so you can remove, tag or skip a bad address in your mail tool. By default only a definite invalid is flagged. If the API is slow or down, the subscriber stays as it is.

It is one TypeScript file with no dependencies, under the MIT licence (the text is at the top of the file). Download it: email-validation-sumo.ts. It runs on Node 22.18 or later, Bun, Deno and Cloudflare Workers; older Node needs a TypeScript build step.

How it works, and its limits

BDOW! cannot hold a subscription back: its webhook is sent after the visitor has subscribed. So the check runs right after:

  1. A visitor subscribes through one of your site's campaign forms, and BDOW! sends one JSON event to your receiver.
  2. BDOW! signs nothing and lets you set only the webhook's URL, so the receiver asks for a token of your own in that URL (?token=…). A delivery without the right token is answered 401 and its body is not read.
  3. Only a live subscription is checked. The event of BDOW!'s Send Test button, a connection check and any other event are answered at once and cost nothing.
  4. The receiver answers BDOW! at once, then checks the subscriber's email with one call to our API and hands the result to your onResult function.

It writes nothing back to BDOW!: BDOW!'s subscriber list has no public API. Acting on a flagged address (removing it from your mail tool's list, a tag, a suppression) is your code's part.

What you need

  • An API key from the API keys page with the permission Validate addresses, and a daily credit cap. Put it in your server's environment as EV_API_KEY, never in a page.
  • A token you make, at least 24 characters of letters and digits only, so it goes into a URL unchanged: for example openssl rand -hex 24, or on Windows your password manager's generator. Put it in your server's environment as BDOW_BRIDGE_TOKEN.
  • A BDOW! site on a paid plan. BDOW!'s webhook is a paid feature, not part of its Free plan; BDOW! offers a 14-day trial.

Set it up

  1. Copy email-validation-sumo.ts into your server code.

  2. Run the receiver. As a Cloudflare Worker:

    import { createSumoWebhook } from './email-validation-sumo.ts';
    
    // Once per isolate, so the receiver's memory (one check per address) lasts across requests.
    let receive: ReturnType<typeof createSumoWebhook> | undefined;
    
    export default {
      fetch(request: Request, env: Record<string, string>, ctx: ExecutionContext) {
        receive ??= createSumoWebhook({
          apiKey: env.EV_API_KEY,
          bridgeToken: env.BDOW_BRIDGE_TOKEN,
          onResult: async (r) => {
            if (r.outcome === 'flagged') await removeFromList(r.delivery.email); // your code: your mail tool
          },
        });
        return receive(request, ctx); // ctx.waitUntil keeps the check running after the answer
      },
    };

    In a Next.js route handler: const receive = createSumoWebhook({ ...the same options, waitUntil: after }) with after from next/server, then export const GET = receive and export const POST = receive. In Express or any long-running server, create createSumoWebhookHandler(options) once and call it with { body, url }: the raw body (express.raw({ type: '*/*', limit: '64kb' })) and req.originalUrl. Answer with its status and body; the check runs on in its done.

  3. In BDOW!, open your site's Site Settings, then Integrations, and scroll to the bottom. Turn the webhook on, enter https://your-server.example/bdow?token=<your token> as the Webhook URL, press Send Test, then Save. The token is part of the URL, so it can show in access logs along the way: BDOW! offers no other way.

  4. To accept only your own site, add its id as siteIds: ['…'] (r.siteId in onResult after the first live subscription). An event of another site is then answered 403.

  5. Test it. Subscribe on your live site with an address of yours that receives mail and watch onResult (outcome: 'clean'). Never subscribe with a test address that cannot receive mail, a sandbox address included: nothing blocks the subscription, so a welcome email to it (from BDOW! or your mail tool) would bounce and hurt your sender. To see the flagged path, call createEmailCheck(options)('no_mailbox@sandbox.email-validation.org') from your server: it is free and always answers invalid.

Options

OptionDefaultWhat it does
apiKeyrequiredOur API key. Missing: nothing is checked.
bridgeTokenrequiredYour token, at least 24 letters, digits, -, _, . or ~; in the webhook URL as ?token=
siteIdsany siteThe BDOW! site ids whose events are taken; another site's event is answered 403
regionuseu validates addresses in the EU and stores their results there, with the same key
flag['invalid']Statuses that flag an address, from invalid, disposable, catch_all, unknown
timeoutMs6000How long to wait for our answer before the subscriber stays unchecked
storenone{ get(key), set(key, value) } (Workers KV, Redis, a table) to remember answers across restarts
waitUntilnoneKeeps the check running after the answer on serverless hosts (Next.js after)
onResultnoneCalled once per live subscription with the outcome, the site and form ids and BDOW!'s event

createEmailCheck(options) is the check alone, for your own code.

When something fails

If our API is slow, out of reach or out of credits, the subscriber stays as it is and onResult gets outcome: 'unchecked' with the reason; the webhook gets 200 either way. A refused key, no credits or the key's daily cap pause the checks for 5 minutes; a rate limit pauses them for the time our API asks. A delivery without the right token is answered 401 and nothing is checked. A GET with the right token answers 200, so you can check the URL in a browser. createSumoWebhook refuses bodies over 64 KiB; with createSumoWebhookHandler, your framework's body limit applies.

What it costs

Each checked address uses one credit. unknown results, malformed addresses and test addresses are free. The receiver remembers each answer for a day (up to 1,000 addresses on one running server): the same address subscribing again, or a repeated delivery, is answered without a new check. To keep answers across restarts or several instances, pass a store.

Privacy

The file writes no log line and puts no key, token or address in an error or an answer. Answers are remembered under the address's SHA-256, never the address. BDOW!'s event, which onResult gets as delivery, holds the visitor's address: keep it out of your logs. The address goes only in the body of a request to our API, never in a URL.

More on BDOW (Sumo)

Updated · Maintained by: Email Validation LLC

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