/designing-email-templates
Author, save, and edit email templates in the PostHog workflows library — compose email design JSON with Liquid personalization and create and round-trip-edit templates over MCP. Use when asked to design, build, update, or fix an email template for workflows, broadcasts, or
$ npx -y skills add posthog/posthog --skill designing-email-templates --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/designing-email-templates
Context preview
The summary Claude sees to decide when to auto-load this skill.
Author, save, and edit email templates in the PostHog workflows library — compose email design JSON with Liquid personalization and create and round-trip-edit templates over MCP. Use when asked to design, build, update, or fix an email template for workflows, broadcasts, or
SKILL.md
designing-email-templates.SKILL.mdname: designing-email-templates
description: 'Author, save, and edit email templates in the PostHog workflows library — compose email design JSON with Liquid personalization and create and round-trip-edit templates over MCP. Use when asked to design, build, update, or fix an email template for workflows, broadcasts, or campaigns.'
Designing email templates
Use this skill when creating or editing email templates for PostHog workflows — broadcast campaigns and `function_email` workflow actions send the rendered template.
How authoring works
You author the **design JSON** (`content.email.design`) and save it with `workflows-create-email-template`. The server renders the sent email from your design with the same renderer PostHog's visual editor uses, so the template opens as editable blocks for humans and sends exactly what the design describes. Schema and a working example in [references/unlayer-design-json.md](references/unlayer-design-json.md).
When talking to the user, call it the template's **design** — the design document format is an internal implementation detail. Always share the template's `_posthogUrl` edit link in your reply after creating or updating, so the user can open it in PostHog directly.
Read [references/design-guidelines.md](references/design-guidelines.md) before composing — it covers committing to a design direction, typography, color, and the patterns that make an email look designed rather than generated. For one fragment the block editor can't express, use an `html`-type content block inside the design.
Personalization with Liquid
Email content uses Liquid templating. Liquid tags pass through the renderer as plain text, so use them anywhere — block text, subject, links:
Hi {{ person.properties.first_name | default: 'there' }},Marketing emails must include an unsubscribe link — render it with the built-in variables:
<a href="{{ unsubscribe_url }}">Unsubscribe</a>(`{{ unsubscribe_url_one_click }}` is also available for one-click list-unsubscribe flows.)
Click tracking and opt-out
Every link is automatically rewritten through a click-tracking redirect. This breaks mobile universal links / app deeplinks, which only resolve when the href stays on their own domain. To keep a link untracked, mark its anchor (use an `html` block) with `clicktracking="off"` or `data-ph-no-track`:
<a href="https://app.example.com/deeplink" data-ph-no-track>Open in app</a>
The marker must be on the `<a>` tag itself, not a child element. Opted-out links get no click metrics.
Creating a template
Call `workflows-create-email-template` with:
{
"name": "Welcome email",
"description": "Sent to new signups on day 0",
"type": "email",
"content": {
"templating": "liquid",
"email": {
"subject": "Welcome to {{ person.properties.company | default: 'our product' }}",
"design": { "counters": { "u_row": 1 }, "schemaVersion": 16, "body": { "rows": ["…"] } },
"text": "Plain-text fallback of the same message"
}
}
}- `subject` is required for email templates.
- Always author the `design` and omit `html` - the server renders html from the design. Sending hand-written html without a design produces an email the visual editor can only show as one raw block.
- Always provide `text` as a real plain-text rendering of the message - clients that block rich content show only `text`, so filler like "placeholder" reaches real inboxes, and a text part that doesn't match the html hurts deliverability.
- The tool result returns an edit link into the PostHog library.
- After creating (or updating), call `workflows-show-email-template` — it renders an inline preview so the user sees the result.
Payload mechanics
Pass the design directly in the tool call — no scratch files, no pre-validation subprocesses, no payload preview rounds. Liquid tags (`{{ }}`, `{% %}`), apostrophes, single quotes, and emoji are ordinary characters inside JSON strings; only standard JSON escaping applies. Never rewrite content to avoid them — converting Liquid's single quotes to double quotes inside markup attributes breaks the markup. If the tool call is rejected as malformed, fix the JSON escaping and resend the same content unchanged.
Editing a template (read–modify–write)
`content` is replaced as a whole on update, never merged — and humans may have edited the design in PostHog's visual editor since you last saw it:
1. `workflows-get-email-template` — always fetch fresh; the returned `design` is the current source of truth. 2. Modify the `design` (keep subject/text alongside it). 3. `workflows-update-email-template` — send the complete `content` back. The server re-renders the sent email from the edited design. 4. `workflows-show-email-template` — render the updated template so the user sees the change; its response carries the final rendered html, so read it before describing the result.
For small changes to an existing design, prefer `workflows-patch-email-template`: id-addressed operations over the Unlayer blocks, so you send only the edit instead of the whole design.
Editing the email inside a workflow step
A `function_email` step carries its own email snapshot (`config.inputs.email.value` with subject/text/html/design), independent of any library template. Edit it with `workflows-patch-action-email`: the same design operations as `workflows-patch-email-template`, plus an `email_patch` merge for subject, preheader, text, and recipients.
1. `workflows-get` — the step's current design (and its block ids) is in `config.inputs.email.value.design`. 2. `workflows-patch-action-email` with the workflow id, the step's `action_id`, and your operations and/or `email_patch`. 3. The HTML is re-rendered server-side from the patched design, so it never goes stale. 4. On an active workflow the edit stages a draft — test with `workflows-test-run` (`use_draft=true`) and apply it with `workflows-publish`.
Us
Read more
name: designing-email-templates description: 'Author, save, and edit email templates in the PostHog workflows library — compose email design JSON with Liquid personalization and create and round-trip-edit templates over MCP. Use when asked to design, build, update, or fix an email template for workflows, broadcasts, or campaigns.'
Designing email templates
Use this skill when creating or editing email templates for PostHog workflows — broadcast campaigns and `function_email` workflow actions send the rendered template.
How authoring works
You author the **design JSON** (`content.email.design`) and save it with `workflows-create-email-template`. The server renders the sent email from your design with the same renderer PostHog's visual editor uses, so the template opens as editable blocks for humans and sends exactly what the design describes. Schema and a working example in [references/unlayer-design-json.md](references/unlayer-design-json.md).
When talking to the user, call it the template's **design** — the design document format is an internal implementation detail. Always share the template's `_posthogUrl` edit link in your reply after creating or updating, so the user can open it in PostHog directly.
Read [references/design-guidelines.md](references/design-guidelines.md) before composing — it covers committing to a design direction, typography, color, and the patterns that make an email look designed rather than generated. For one fragment the block editor can't express, use an `html`-type content block inside the design.
Personalization with Liquid
Email content uses Liquid templating. Liquid tags pass through the renderer as plain text, so use them anywhere — block text, subject, links:
Hi {{ person.properties.first_name | default: 'there' }},Marketing emails must include an unsubscribe link — render it with the built-in variables:
<a href="{{ unsubscribe_url }}">Unsubscribe</a>(`{{ unsubscribe_url_one_click }}` is also available for one-click list-unsubscribe flows.)
Click tracking and opt-out
Every link is automatically rewritten through a click-tracking redirect. This breaks mobile universal links / app deeplinks, which only resolve when the href stays on their own domain. To keep a link untracked, mark its anchor (use an `html` block) with `clicktracking="off"` or `data-ph-no-track`:
<a href="https://app.example.com/deeplink" data-ph-no-track>Open in app</a>
The marker must be on the `<a>` tag itself, not a child element. Opted-out links get no click metrics.
Creating a template
Call `workflows-create-email-template` with:
{
"name": "Welcome email",
"description": "Sent to new signups on day 0",
"type": "email",
"content": {
"templating": "liquid",
"email": {
"subject": "Welcome to {{ person.properties.company | default: 'our product' }}",
"design": { "counters": { "u_row": 1 }, "schemaVersion": 16, "body": { "rows": ["…"] } },
"text": "Plain-text fallback of the same message"
}
}
}- `subject` is required for email templates.
- Always author the `design` and omit `html` - the server renders html from the design. Sending hand-written html without a design produces an email the visual editor can only show as one raw block.
- Always provide `text` as a real plain-text rendering of the message - clients that block rich content show only `text`, so filler like "placeholder" reaches real inboxes, and a text part that doesn't match the html hurts deliverability.
- The tool result returns an edit link into the PostHog library.
- After creating (or updating), call `workflows-show-email-template` — it renders an inline preview so the user sees the result.
Payload mechanics
Pass the design directly in the tool call — no scratch files, no pre-validation subprocesses, no payload preview rounds. Liquid tags (`{{ }}`, `{% %}`), apostrophes, single quotes, and emoji are ordinary characters inside JSON strings; only standard JSON escaping applies. Never rewrite content to avoid them — converting Liquid's single quotes to double quotes inside markup attributes breaks the markup. If the tool call is rejected as malformed, fix the JSON escaping and resend the same content unchanged.
Editing a template (read–modify–write)
`content` is replaced as a whole on update, never merged — and humans may have edited the design in PostHog's visual editor since you last saw it:
1. `workflows-get-email-template` — always fetch fresh; the returned `design` is the current source of truth. 2. Modify the `design` (keep subject/text alongside it). 3. `workflows-update-email-template` — send the complete `content` back. The server re-renders the sent email from the edited design. 4. `workflows-show-email-template` — render the updated template so the user sees the change; its response carries the final rendered html, so read it before describing the result.
For small changes to an existing design, prefer `workflows-patch-email-template`: id-addressed operations over the Unlayer blocks, so you send only the edit instead of the whole design.
Editing the email inside a workflow step
A `function_email` step carries its own email snapshot (`config.inputs.email.value` with subject/text/html/design), independent of any library template. Edit it with `workflows-patch-action-email`: the same design operations as `workflows-patch-email-template`, plus an `email_patch` merge for subject, preheader, text, and recipients.
1. `workflows-get` — the step's current design (and its block ids) is in `config.inputs.email.value.design`. 2. `workflows-patch-action-email` with the workflow id, the step's `action_id`, and your operations and/or `email_patch`. 3. The HTML is re-rendered server-side from the patched design, so it never goes stale. 4. On an active workflow the edit stages a draft — test with `workflows-test-run` (`use_draft=true`) and apply it with `workflows-publish`.
Us
:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Repo: posthog/posthog
Other skills on posthog.
- /analyzing-expensive-users
Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top spenders, expensive users, per-user LLM cost, user-level cost drivers, or patterns behind high AI observability spend.
Open skill - /creating-online-evaluations
Author continuously-running online evaluations in PostHog AI observability, grounded in real failure modes you've identified. Use when the user wants evaluations that automatically score new generations or whole traces going forward — "create an eval to catch X", "continuously
Open skill - /exploring-ai-failures
Find where an AI/LLM application is failing in production and surface the failure patterns, working from real traces. Use when someone wants to understand what's going wrong with an AI feature, find and categorize failure modes, triage errors, or investigate quality issues
Open skill - /exploring-llm-clusters
Investigate AI observability clusters — understand usage patterns in AI/LLM traffic, compare cluster behavior, compute cost/latency metrics, and drill into individual traces within clusters.
Open skill - /exploring-llm-costs
Investigate LLM spend in PostHog — total cost over time, cost by model, provider, user, trace, or custom dimension, token and cache-hit economics, and cost regressions. Use when the user asks "how much are we spending on LLMs?", "which model / user / feature is most expensive?",
Open skill - /exploring-llm-evaluations
Investigate AI observability evaluations — `hog` (deterministic code-based), `llm_judge` (LLM-prompt-based), and `sentiment` (user-message sentiment). Find existing evaluations, inspect their configuration, run them against specific generations, query individual results, and
Open skill

