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.
Add this skill
npx mdskills install PostHog/designing-email-templates@PostHog? Sign in with GitHub to claim this listing.Comprehensive email template authoring skill with clear workflow, personalization guidance, and design best practices
1---2name: designing-email-templates3description: '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.'4---56# Designing email templates78Use this skill when creating or editing email templates for PostHog workflows — broadcast campaigns and `function_email` workflow actions send the rendered template.910## How authoring works1112You 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).1314When 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.1516Read [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.1718## Personalization with Liquid1920Email content uses Liquid templating. Liquid tags pass through the renderer as plain text, so use them anywhere — block text, subject, links:2122```liquid23Hi {{ person.properties.first_name | default: 'there' }},24```2526Marketing emails must include an unsubscribe link — render it with the built-in variables:2728```html29<a href="{{ unsubscribe_url }}">Unsubscribe</a>30```3132(`{{ unsubscribe_url_one_click }}` is also available for one-click list-unsubscribe flows.)3334## Creating a template3536Call `workflows-create-email-template` with:3738```json39{40 "name": "Welcome email",41 "description": "Sent to new signups on day 0",42 "type": "email",43 "content": {44 "templating": "liquid",45 "email": {46 "subject": "Welcome to {{ person.properties.company | default: 'our product' }}",47 "design": { "counters": { "u_row": 1 }, "schemaVersion": 16, "body": { "rows": ["…"] } },48 "text": "Plain-text fallback of the same message"49 }50 }51}52```5354- `subject` is required for email templates.55- Always provide `text` — it's the fallback for clients that block rich content and improves deliverability.56- The tool result returns an edit link into the PostHog library.57- After creating (or updating), call `workflows-show-email-template` — it renders an inline preview so the user sees the result.5859### Payload mechanics6061Pass 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.6263## Editing a template (read–modify–write)6465`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:66671. `workflows-get-email-template` — always fetch fresh; the returned `design` is the current source of truth.682. Modify the `design` (keep subject/text alongside it).693. `workflows-update-email-template` — send the complete `content` back. The server re-renders the sent email from the edited design.704. `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.7172## Using templates7374- List what exists with `workflows-list-email-templates` (metadata only; fetch one for its content).75- When the user asks to see a template, call `workflows-show-email-template` — it renders an inline preview.76- Reference a template from a workflow's `function_email` action, or start a broadcast from it in the PostHog UI.77- Templates are soft-deleted by setting `deleted: true` via `workflows-update-email-template`.78
Full transparency — inspect the skill content before installing.