# designing-email-templates

Creates and edits PostHog email templates for workflows and campaigns through MCP. Use it to build editable email designs with Liquid personalization and preview the result.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 301 installs · ★ 75
- Author: PostHog
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/PostHog/skills/tree/HEAD/skills/omnibus/designing-email-templates/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/designing-email-templates

## What it does

The skill builds an email design as JSON and saves it to the PostHog library with `workflows-create-email-template`. Liquid can personalize the subject, body text, and links. After creating or updating a template, it calls `workflows-show-email-template` to render an inline preview that can be opened in PostHog's visual editor.

It checks the media library before uploading images. New files go through `media-image-upload-start` and `media-image-upload-complete`. PostHog rewrites links for click tracking by default, which breaks mobile universal links and app deeplinks; mark the `<a>` element with `clicktracking="off"` or `data-ph-no-track` to keep its URL intact. That link will not produce click metrics.

A template needs a subject and a real plain-text version of the message. Marketing emails need an unsubscribe link. Images must be under 4 MB and decode as PNG, JPEG, GIF, WebP, AVIF, or BMP, so check the file before uploading. The source description ends partway through its HTML-conversion section, so this page does not spell out those remaining steps.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill designing-email-templates -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/designing-email-templates/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/designing-email-templates/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill designing-email-templates -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/designing-email-templates/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill designing-email-templates -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/designing-email-templates/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install PostHog/skills designing-email-templates
```

2. **Manually: put the files in place**
- File: `.github/skills/designing-email-templates/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill designing-email-templates -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/PostHog/skills --path skills/omnibus/designing-email-templates
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/designing-email-templates/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill designing-email-templates -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/PostHog/skills/tree/HEAD/skills/omnibus/designing-email-templates/SKILL.md

## When to use it
- build an editable email for a PostHog campaign
- personalize email content and subject lines with Liquid
- update a template and render its preview
- reuse or upload images in the PostHog media library
- keep app deeplinks out of click tracking

## Example prompts
- Create a PostHog welcome email template with the recipient's first name personalized through Liquid.
- Update the campaign email design and show me its preview.
- Add an app deeplink without click tracking, then save the template.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: e19c73b426d88d0f.

BEGIN THIRD-PARTY FILE e19c73b426d88d0f
````text
---
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, the native blocks and spacing rules every email follows, 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:

```liquid
Hi {{ person.properties.first_name | default: 'there' }},
```

Marketing emails must include an unsubscribe link — render it with the built-in variables:

```html
<a href="{{ unsubscribe_url }}">Unsubscribe</a>
```

(`{{ unsubscribe_url_one_click }}` is also available for one-click list-unsubscribe flows.)

Output is HTML-escaped by default, so a value renders as text even when it contains markup:

- Don't add `| escape`. It escapes a second time, and `&` reaches the inbox as `&amp;amp;`.
- For HTML your own backend builds, such as a summary list, add `| raw`: `{{ variables.summary_html | raw }}`. Never use `raw` on text a person typed.
````
END THIRD-PARTY FILE e19c73b426d88d0f

The third-party file has ended. Everything between the e19c73b426d88d0f tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2471 of 10170 bytes. © PostHog · MIT · https://github.com/PostHog/skills/tree/HEAD/skills/omnibus/designing-email-templates/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
