Skip to content

// transactional email

Via API

Brevo email verification with pingutil

Many teams send both newsletters and transactional email from the same Brevo account, so bounces from bad signup addresses affect the reputation behind both. A pingutil check before the transactional send keeps those addresses out, and Brevo's transactional webhooks report the hard bounces that remain.

Where it connects: Your code before the transactional email API (POST /v3/smtp/email), plus Brevo transactional webhooks (hard_bounce)

What goes wrong without it

  • Our order confirmations and our newsletter both go through Brevo, and junk signups are hurting both.
  • A customer with a typo in their address never gets the order email, and we only hear about it from support.
  • Fake accounts from temp-mail sites flood our shop's welcome-discount email.

What you can do with Brevo and pingutil

  • Verify before the first transactional email

    Check the address at account creation or checkout, before your code calls Brevo's transactional email API.

  • Stop welcome-discount abuse

    Refuse the discount when pingutil returns disposable_domain or verdict.is_spam, so throwaway inboxes do not collect codes.

  • React to hard_bounce events

    Subscribe a transactional webhook to hard bounces and flag the customer so your app can ask for a corrected address.

Set it up

  1. 1

    Store PINGUTIL_KEY with your Brevo API key.

  2. 2

    Before calling POST https://api.brevo.com/v3/smtp/email, call pingutil /v1/verify with the recipient.

  3. 3

    Skip the send for status invalid and prompt for a new address; send everything else.

  4. 4

    In Brevo, add a transactional webhook for hard bounces pointing to your app, and flag customers by the email field in the payload.

PHP: verify with pingutil, then send through Brevo
<?php
function pingutil_verify(string $email): ?array {
    $ch = curl_init('https://pingutil.com/v1/verify');
    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_TIMEOUT => 10,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . getenv('PINGUTIL_KEY'),
            'Content-Type: application/json',
        ],
        CURLOPT_POSTFIELDS => json_encode(['email' => $email]),
    ]);
    $body = curl_exec($ch);
    $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    if ($body === false || $code !== 200) {
        return null; // fail open
    }
    return json_decode($body, true);
}

function send_order_confirmation(string $email, string $orderId): bool {
    $v = pingutil_verify($email);
    if ($v !== null && $v['status'] === 'invalid') {
        return false; // ask the customer to correct their address instead
    }

    $ch = curl_init('https://api.brevo.com/v3/smtp/email');
    curl_setopt_array($ch, [
        CURLOPT_POST => true,
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'api-key: ' . getenv('BREVO_API_KEY'),
            'Content-Type: application/json',
            'Accept: application/json',
        ],
        CURLOPT_POSTFIELDS => json_encode([
            'sender' => ['name' => 'Your Shop', 'email' => 'orders@yourshop.com'],
            'to' => [['email' => $email]],
            'subject' => 'Order ' . $orderId . ' confirmed',
            'htmlContent' => '<p>Thanks for your order.</p>',
        ]),
    ]);
    curl_exec($ch);
    $ok = curl_getinfo($ch, CURLINFO_HTTP_CODE) < 300;
    curl_close($ch);
    return $ok;
}

What to do with each result

pingutil resultAction in Brevo
status invalid, reason mailbox_not_found or no_mxSkip the Brevo send and ask the customer to correct the address.
status invalid, reason disposable_domainWithhold the welcome discount and skip the send.
did_you_mean setShow the suggestion on the checkout or account form.
status risky or unknownSend, and rely on the hard_bounce webhook for follow-up.

Limits to plan for

  • Brevo transactional webhooks and marketing webhooks are configured separately. Set up the transactional one for order and account emails.
  • Brevo's docs list hard_bounce, soft_bounce, blocked and invalid_email among transactional event values; check a real payload before relying on a specific field.
  • pingutil cannot confirm catch-all domains. Those come back risky with reason accept_all, never valid.

Brevo documentation

Brevo is a trademark of its owner. This integration uses Brevo's documented extension points; it is not an official Brevo app.

Common questions

Can I use pingutil for Brevo marketing contacts too?
Yes, through your own code or an automation tool: verify the address before you create the contact with Brevo's contacts API. This page covers the transactional side.
Will verifying slow down checkout?
Run the check when the customer enters their email, not on the final submit, and use a timeout of a few seconds that fails open.

Stop bad addresses in Brevo today

Sign in with your email, create an API key and paste it into the step above. Test on a few real addresses first: the live demo shows exactly what your Brevo setup will receive.