// transactional email
Via APIMandrill (Mailchimp Transactional) email verification with pingutil
Mandrill adds hard-bounced addresses to its Rejection Denylist, so after one bad send a user's receipts and alerts are rejected without anyone noticing. A pingutil check before messages/send stops typos and disposable addresses from getting there, and Mandrill's webhooks show you who already has.
Where it connects: Your code before messages/send, plus Mandrill webhooks (hard_bounce, reject)
What goes wrong without it
- Customers tell support they stopped getting receipts, and it turns out their address is on our Mandrill denylist from a typo years ago.
- We pay for Mandrill blocks, and some of that volume is going to fake accounts.
- Our marketing and transactional mail share a Mailchimp account, so transactional bounces are something the whole team sees.
What you can do with Mandrill (Mailchimp Transactional) and pingutil
Verify before messages/send
Call /v1/verify in the code path that sends account mail, and skip the Mandrill call for invalid addresses.
Avoid spending Mandrill volume on throwaway accounts
Use the fast lookup at signup and block verdict.is_spam, so disposable and randomized accounts never trigger transactional sends.
Watch hard_bounce and reject events
Mandrill posts webhooks as a mandrill_events form field. Loop over the events and flag users on hard_bounce or reject so your app can ask for a new address.
Set it up
- 1
Store PINGUTIL_KEY with your Mandrill API key.
- 2
Call pingutil /v1/verify before POST https://mandrillapp.com/api/1.0/messages/send.
- 3
Skip invalid addresses; send to the rest.
- 4
Add a webhook in Mandrill for hard_bounce and reject events, and authenticate incoming requests as described in Mandrill's webhook docs.
- 5
Flag matching users and verify any replacement address before sending to it.
require "net/http"
require "json"
def post_json(url, body, headers = {}, timeout: 10)
uri = URI(url)
Net::HTTP.start(uri.host, uri.port, use_ssl: true, open_timeout: 3, read_timeout: timeout) do |http|
req = Net::HTTP::Post.new(uri, { "Content-Type" => "application/json" }.merge(headers))
req.body = body.to_json
http.request(req)
end
end
def pingutil_verify(email)
res = post_json("https://pingutil.com/v1/verify", { email: email },
{ "Authorization" => "Bearer #{ENV.fetch('PINGUTIL_KEY')}" })
res.is_a?(Net::HTTPSuccess) ? JSON.parse(res.body) : nil
rescue StandardError
nil # fail open on timeouts and network errors
end
def send_receipt(email, order_id)
v = pingutil_verify(email)
return :invalid_address if v && v["status"] == "invalid"
post_json("https://mandrillapp.com/api/1.0/messages/send", {
key: ENV.fetch("MANDRILL_API_KEY"),
message: {
from_email: "receipts@yourapp.com",
subject: "Receipt for order #{order_id}",
text: "Thanks for your order.",
to: [{ email: email, type: "to" }]
}
})
:sent
endWhat to do with each result
| pingutil result | Action in Mandrill (Mailchimp Transactional) |
|---|---|
| status invalid (mailbox_not_found, mailbox_disabled) | Skip messages/send so the address never reaches the Rejection Denylist. |
| verdict.is_spam true at signup | Block the account, so it never triggers transactional sends. |
| status risky, reason accept_all | Send. A hard_bounce webhook will tell you if it fails. |
| status unknown | Send and keep the user flagged as unchecked. |
Limits to plan for
- Mandrill webhooks arrive as a mandrill_events form parameter holding a JSON array of up to 1,000 events per request, so your handler must parse and loop over it.
- Mandrill is an add-on to a Mailchimp account; webhooks and the denylist are managed in the Mandrill app, not in Mailchimp marketing.
- pingutil checks are point-in-time. Keep the webhook handler even after you add verification at signup.
Mandrill (Mailchimp Transactional) documentation
- mailchimp.com/developer/transactional/docs/webhooks/
- mailchimp.com/developer/transactional/guides/track-respond-activity-webhooks/
Mandrill (Mailchimp Transactional) is a trademark of its owner. This integration uses Mandrill (Mailchimp Transactional)'s documented extension points; it is not an official Mandrill (Mailchimp Transactional) app.
Common questions
- Can pingutil remove addresses from my Mandrill denylist?
- No. pingutil only tells you whether an address looks deliverable now. Removing a denylist entry is done in Mandrill, and only makes sense when the mailbox has really been fixed.
- Should I verify in the webhook handler?
- Not for hard_bounce events, since Mandrill already knows the mailbox failed. Verify when a user gives you a replacement address.
Stop bad addresses in Mandrill (Mailchimp Transactional) 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 Mandrill (Mailchimp Transactional) setup will receive.