# Resend bounce or spam complaint notifications on your phone > Get a push notification when an email you sent through Resend bounces, and a High-priority one when a recipient marks it as spam. - Company: Resend (https://www.justpush.io/recipes/resend) - Event: `email.bounced` (email.bounced and email.complained) - Tags: Email delivery, Email deliverability - Install: https://studio.justpush.io/recipes/resend/bounce-or-complaint - Web page: https://www.justpush.io/recipes/resend/bounce-or-complaint ## Setup 1. Click Install in Studio and sign in. The recipe is added to your account and you get a personal webhook URL. 2. In Resend, open Webhooks and click Add Webhook. 3. Paste your webhook URL (shown in Studio after install) as the endpoint URL and select the email.bounced and email.complained events. 4. Save the webhook. 5. When you add the webhook in Resend (**Webhooks → Add Webhook**), select **email.bounced** and **email.complained**. Each event gives one push: 6. a spam complaint (`email.complained`) is High priority, because complaints damage your sender reputation fastest; 7. a hard or undetermined bounce is Normal priority, and a soft (transient) bounce is Low. 8. Resend signs every delivery with Svix headers (`svix-id`, `svix-timestamp`, `svix-signature`), but JustPush doesn't check that signature yet, so keep your endpoint URL private. ## Code Studio calls `handleRequest(request)` with the incoming webhook (`{ method, headers, body, query, raw }`) and sends the message object it returns. Returning `null` sends nothing. ```js // Resend → email.bounced / email.complained // Fires when an email you sent through Resend bounces, or when the recipient marks it as spam. // Docs: https://resend.com/docs/webhooks/emails/bounced // Bounce types from Resend's bounce docs, and how loud each one is. const BOUNCE_TYPES = { Permanent: { label: "hard bounce", priority: 0 }, // the address is dead; worth knowing, not urgent Undetermined: { label: "bounce", priority: 0 }, Transient: { label: "soft bounce", priority: -1 }, // may still be delivered later } // Sub-types worth spelling out. "General", "NoEmail" and "Undetermined" add nothing. const SUBTYPES = { MailboxFull: "mailbox full", MessageTooLarge: "message too large", ContentRejected: "content rejected", AttachmentRejected: "attachment rejected", Suppressed: "address is suppressed", OnAccountSuppressionList: "address is on your suppression list", } // Look a key up without tripping over inherited names like "toString". function pick(table, key, fallback) { return Object.prototype.hasOwnProperty.call(table, key) ? table[key] : fallback } // Only link to real http(s) URLs. function link(url, cta) { return typeof url === "string" && /^https?:\/\//.test(url) ? [{ cta, url }] : [] } // A trimmed string, or null. function text(value) { return typeof value === "string" && value.trim() ? value.trim() : null } // ["a@example.com", "b@example.com"] → "a@example.com +1 more" function recipients(to) { const list = (Array.isArray(to) ? to : [to]).map(text).filter(Boolean) if (!list.length) return null return list[0] + (list.length > 1 ? ` +${list.length - 1} more` : "") } function handleRequest(request) { const body = request.body && typeof request.body === "object" ? request.body : {} const data = body.data && typeof body.data === "object" ? body.data : null // Guard: only bounces and complaints, so other Resend events on this integration stay quiet. if (!data || !["email.bounced", "email.complained"].includes(body.type)) { console.log(`Ignoring Resend "${body.type ?? "unknown"}" event`) return null } const to = recipients(data.to) ?? "A recipient" const subject = text(data.subject) // The dashboard URL pattern isn't in Resend's webhook docs; it's where the email opens in the app. const buttons = text(data.email_id) ? link(`https://resend.com/emails/${encodeURIComponent(data.email_id)}`, "View email") : [] if (body.type === "email.complained") { return { title: "🚨 Spam complaint", message: `${to} marked ${subject ? `"${subject}"` : "your email"} as spam`, topic: "Resend", priority: 1, // High: complaints hurt your sender reputation far more than bounces buttons, } } const bounce = data.bounce && typeof data.bounce === "object" ? data.bounce : {} const type = pick(BOUNCE_TYPES, bounce.type, { label: "bounce", priority: 0 }) const detail = pick(SUBTYPES, bounce.subType, null) return { title: "â†Šī¸ Email bounced", message: [to, subject ? `"${subject}"` : null, type.label + (detail ? ` (${detail})` : "")] .filter(Boolean) .join(" ¡ "), topic: "Resend", priority: type.priority, buttons, } } ``` ## Resend email.bounced webhook payload (sample) ```json { "data": { "to": [ "sam@example.com" ], "from": "Acme ", "tags": { "category": "confirm_email" }, "bounce": { "type": "Permanent", "message": "The recipient's email provider sent a hard bounce message.", "subType": "General" }, "subject": "Confirm your email", "email_id": "56761188-7520-42d8-8898-ff6fc54ce618", "created_at": "2026-09-29T08:41:11.894Z", "message_id": "<111-222-333@email.example.com>" }, "type": "email.bounced", "created_at": "2026-09-29T08:41:12.126Z" } ``` ## FAQ ### Does this work on iPhone and Android? Yes. Install the JustPush app from the App Store or Google Play and sign in. Every phone signed in to your account gets the notification. ### Do I need to write code? No. Install the recipe in Studio, paste your webhook URL into Resend and you are done. The code is there if you want to change the text, the sound or the buttons. ### Can I change what the notification says? Yes. After install the recipe's code is yours. Edit it in Studio and test it against the sample payload before you save. ### What does it cost? JustPush is free for 30 days. After that it's $19.99 a year, or $39.99 once. There is no extra charge for recipes.