// email marketing and newsletters
Via APIGhost email verification with pingutil
Ghost lets anyone become a free member with just an email, and spam signups and typos end up on your newsletter, where bounces hurt delivery for every post. A member.added webhook from a custom integration sends each new member to your endpoint, pingutil checks the address, and the Admin API adds a label you can filter on when sending or cleaning members.
Where it connects: Ghost custom integration webhook (member.added event) plus the Admin API members edit endpoint
What goes wrong without it
- Bots keep signing up as free members with random addresses, and Ghost sends every new post to them.
- Our newsletter bounce rate climbed after a post went viral and brought in hundreds of signups.
- We want to see which members are real before we launch paid tiers.
What you can do with Ghost and pingutil
Label members on signup
Each member.added event is verified, and the member gets a pingutil-invalid, pingutil-risky or pingutil-typo label in Ghost Admin.
Filter labels before sending
Use Ghost's member filters on the pingutil labels to review and remove invalid members, or exclude labelled members when you send to a segment.
Spot bot signups
Randomized local parts come back risky with reason randomized_local_part, which is a strong hint that a script, not a reader, signed up.
Set it up
- 1
In Ghost Admin, go to Settings, Advanced, Integrations, and add a custom integration. Copy its Admin API key.
- 2
In the same integration, add a webhook with the Member added event and your endpoint URL.
- 3
Deploy the endpoint below with the Admin API key, your Ghost admin URL and a pingutil API key.
- 4
Sign up as a member with a test address and check the label in the Members list.
import express from 'express';
import jwt from 'jsonwebtoken';
const app = express();
app.use(express.json());
// Admin API key format "id:secret"; tokens last at most 5 minutes.
function ghostToken() {
const [id, secret] = process.env.GHOST_ADMIN_KEY.split(':');
return jwt.sign({}, Buffer.from(secret, 'hex'), { keyid: id, algorithm: 'HS256', expiresIn: '5m', audience: '/admin/' });
}
async function verify(email) {
try {
const res = await fetch('https://pingutil.com/v1/verify', {
method: 'POST',
headers: { authorization: 'Bearer ' + process.env.PINGUTIL_KEY, 'content-type': 'application/json' },
body: JSON.stringify({ email }),
signal: AbortSignal.timeout(30000),
});
return res.ok ? await res.json() : null;
} catch {
return null; // fail open
}
}
async function handle(member) {
const v = await verify(member.email);
if (!v || v.status === 'valid') return;
const label = v.did_you_mean ? 'pingutil-typo' : 'pingutil-' + v.status;
// Labels sent on edit replace the member's labels, so keep the existing ones.
const labels = (member.labels || []).map((l) => ({ name: l.name })).concat({ name: label });
await fetch(process.env.GHOST_URL + '/ghost/api/admin/members/' + member.id + '/', {
method: 'PUT',
headers: { authorization: 'Ghost ' + ghostToken(), 'content-type': 'application/json', 'accept-version': 'v5.0' },
body: JSON.stringify({ members: [{ labels }] }),
});
}
app.post('/hooks/ghost/' + process.env.HOOK_SECRET, (req, res) => {
res.sendStatus(200);
const member = req.body?.member?.current;
if (member?.id && member?.email) handle(member).catch(console.error);
});
app.listen(3000);What to do with each result
| pingutil result | Action in Ghost |
|---|---|
| status: "invalid" | Label pingutil-invalid; review and delete or unsubscribe those members in Ghost Admin. |
| reason: "randomized_local_part" | Comes back risky; labelled pingutil-risky, a likely bot signup. |
| status: "risky" or "unknown" | Label and keep; exclude from sends where bounces would hurt. |
| did_you_mean is set | Label pingutil-typo and reach out to the corrected address. |
Limits to plan for
- Ghost treats any non-2xx response as a failed delivery and does not document webhook retries or signatures, so keep a secret in the URL and answer 200 straight away.
- Admin API tokens expire within 5 minutes and must be generated server-side; never put the Admin API key in a theme.
- pingutil checks up to 300 addresses per account per day (3,000 a month); a viral post can bring more signups than that in a day. Those are Free plan limits; Enterprise has custom limits.
Ghost documentation
Ghost is a trademark of its owner. This integration uses Ghost's documented extension points; it is not an official Ghost app.
Common questions
- Why labels instead of deleting members automatically?
- Labels are easy to review and undo. Mailbox-not-found results are reliable, but a person who mistyped their address may still want to sign up again, and a human check costs little.
- Does this work on Ghost(Pro) and self-hosted Ghost?
- Custom integrations, webhooks and the Admin API exist on both. Your endpoint just has to be reachable from the internet.
Stop bad addresses in Ghost 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 Ghost setup will receive.