Move from Resend

PostHog imports your Resend suppression list, unsubscribes, topics, contacts, templates, and automations in one background import.

Or let your agent do it. Connect the PostHog MCP:

Install the PostHog MCP

npx @posthog/wizard mcp add

Then ask:

“Move our email from Resend to PostHog.”

What moves

From ResendIn PostHog
Suppression listSuppression list. Hard bounces block all email. Spam complaints and addresses your team added block marketing email only, so they still get transactional email. Resend blocks all email to them.
Unsubscribed contactsOpted out of all marketing email
Public topics, and who opted out of eachMarketing categories and opt-outs
Contacts and their propertiesPeople who already exist, matched by email, with their first and last name. Pick New people from contacts too to create a person for each email that matches nobody, and Contact properties to copy custom properties. A cohort of all contacts, and one for each segment.
TemplatesTemplates, keyed by their Resend alias
AutomationsDraft automations
DomainsA list, so you know which to add

API keys, webhooks, private topics, send history, and stats stay in Resend.

Run the import

  1. Create an API key at resend.com/api-keys with Full access. Resend has no read-only keys, so PostHog refuses a sending-only key. PostHog only reads, and deletes the key when the import ends.
  2. Go to Messaging > Opt-outs and click Import from another tool.
  3. Pick Resend, paste the key, pick what to import, and click Start import.
The Resend import, with the key field and the list of steps

Resend shares topic preferences and contact properties one contact at a time, so PostHog reads about 25,000 contacts an hour. If the import stops partway, start it again with the key, and it picks up where it left off.

The Contacts step needs Suppression list, Unsubscribed contacts, and Topic preferences in the same import, so nobody who left in Resend gets marketing email. Each person it creates or updates counts as an event on your bill.

Switch your sending

1. Set up your domain

Set up your domain in PostHog, and publish its DNS records. PostHog needs its own records, even for a domain that already sends through Resend. Keep Resend's records until nothing sends through it. If Resend uses the feedback subdomain, pick another MAIL FROM subdomain in PostHog. The import says when this applies.

2. Move your transactional email

Change your code one email at a time, starting with a low-risk one. You need a project secret API key. These examples use Node.js. Each SDK page has the same send in its language.

If your code writes the HTML, send it as it is. Name the email with a templateKey, so PostHog groups its metrics and logs.

Before, with Resend:

JavaScript
import { Resend } from "resend"
const resend = new Resend(process.env.RESEND_API_KEY)
const { error } = await resend.emails.send({
from: "Hedgebox <security@hedgebox.net>",
to: "jane@example.com",
subject: "Reset your password",
html,
})

After, with PostHog:

JavaScript
import { PostHog } from "posthog-node"
const posthog = new PostHog("<ph_project_token>", {
host: "https://us.i.posthog.com",
secretKey: process.env.POSTHOG_PROJECT_SECRET_API_KEY,
})
const { error } = await posthog.emails.send({
from: "Hedgebox <security@hedgebox.net>",
to: "jane@example.com",
templateKey: "password-reset",
subject: "Reset your password",
html,
distinctId: userId,
})

If you send a Resend template, the import copied it into PostHog. The import doesn't make it transactional, because it can't tell which templates your app sends, and a transactional email skips opt-outs and the frequency cap. Open it in the email library, make it transactional, and copy its template ID from its API tab. Pass the same variables. Resend fills FIRST_NAME, LAST_NAME, and EMAIL from the contact. PostHog doesn't, so pass them too.

Before, with Resend:

JavaScript
const { error } = await resend.emails.send({
from: "Hedgebox <hello@hedgebox.net>",
to: "jane@example.com",
template: { id: "welcome", variables: { PLAN: "Pro" } },
})

After, with PostHog:

JavaScript
const { error } = await posthog.emails.send({
to: "jane@example.com",
templateId: "<template_id>",
templateData: { FIRST_NAME: "Jane", PLAN: "Pro" },
distinctId: userId,
})

A send to an address on the suppression list fails with recipient_suppressed. Don't retry it.

3. Turn on your automations

Each imported automation is a draft, and lists the events your app must send to PostHog. Turn each one on as you turn off the Resend one, so nobody gets the same email twice.

Watch for

  • Suppressions: spam complaints and addresses your team added still get transactional email in PostHog. Resend blocks all email to them.

  • Images: the import keeps each image's address. An image that Resend hosts stops loading once you close your Resend account, so copy it into PostHog first.

“Copy the images that Resend hosts in our imported templates into PostHog, and point the templates at the copies.”

See switch over safely for the full checklist.

Still have questions?

Was this page useful?