> AI agents: this is one page from PostHog's docs. Full index of Markdown docs for LLMs: https://posthog.com/llms.txt # Transactional emails Canonical URL: https://posthog.com/docs/workflows/transactional > **Cloud region:** This page uses US Cloud hosts. For an EU Cloud project, use `https://eu.posthog.com` instead of `https://app.posthog.com` (app host for links). ## On this page - [Send from your code](#send-from-your-code) - [Or build it in PostHog](#or-build-it-in-posthog) - [See each send](#see-each-send) - [Metrics and conversions](#metrics-and-conversions) A transactional email goes to one person when your code sends it, such as a password reset, a sign-in code, or a receipt. Your code sends them, and the [**Transactional**](https://app.posthog.com/transactional) app in PostHog shows every send and what each person did next. New here? [Send your first one from code](https://posthog.com/docs/workflows/installation/quick-start.md). ## Send from your code Your server sends the subject and HTML with one call from the [PostHog SDK](https://posthog.com/docs/workflows/installation/quick-start.md), named by a key such as `password-reset`. The email lives in your codebase, as HTML that your code builds. Each key shows in the list after its first send, with its sends and metrics. Link each one to the file in your repo that sends it, and **Copy prompt for your agent** gives your coding agent that file, so it knows what to edit. See [send emails from code](https://posthog.com/docs/workflows/transactional/send-from-code.md#send-the-html). Ask your agentwith the [PostHog MCP](https://posthog.com/docs/workflows/mcp.md)[sending-transactional-emails](https://posthog.com/docs/workflows/skills.md) “Add a sign-in code email to our app that sends through PostHog.” Copy ## Or build it in PostHog To let your team change an email without a deploy, build it in PostHog instead. Click **New transactional email**. Give it a name, pick a sender, and write it in the [email editor](https://posthog.com/docs/workflows/email-editor.md). Under **Variables your code sends**, add the values your code passes with each send, such as `first_name`. Your code then sends the email by its template ID. See [templates in PostHog](https://posthog.com/docs/workflows/transactional/templates.md). ![A new transactional email in the editor, with the variables your code sends](https://res.cloudinary.com/dmukukwp6/image/upload/w_1600,c_limit,q_auto,f_auto/transactional_create_light_84e61b2a4e.png) Transactional emails ignore marketing opt-outs, so don't use them for marketing. After you publish an email, later edits save as a draft until you publish again. For sign-in codes and reset links, turn on **Protect sensitive data** on the email's **API** tab. PostHog keeps no copy of what each email contained, and turns off link click tracking by default. See [sensitive data and tracking](https://posthog.com/docs/workflows/transactional/sensitive-data.md). ## See each send The **Log** tab lists every send from the last 30 days. Filter it by email, status, or bounce reason. Open a send to see: - Its timeline: sent, delivered, opened, and clicked. - The email the person got, unless the email protects sensitive data. - What the person did in the 7 days before and after, with a link to the [Session Replay](https://posthog.com/docs/session-replay.md). ![One send in the log, with its timeline and what the person did around it](https://res.cloudinary.com/dmukukwp6/image/upload/w_1600,c_limit,q_auto,f_auto/pp_recipient_activity_light_bb68d5b296.png) Your code can also read a send's status. See [check an email's status](https://posthog.com/docs/workflows/transactional/status.md). ## Metrics and conversions The **Metrics** tab counts sends, deliveries, bounces, spam complaints, opens, and clicks, for each email or each sending domain. **What happened after** shows how many people did an event, such as `paid_bill`, after an email. Each email's **Impact** tab shows the funnel from send to click to that event. See [transactional email metrics](https://posthog.com/docs/workflows/metrics.md#transactional-emails). PostHog counts opens and clicks only for emails sent with [tracking](https://posthog.com/docs/workflows/email/link-tracking.md) on. For every sending endpoint and field, see the [transactional email API reference](https://posthog.com/docs/api/transactional-email.md).