Designing email templates
SkillCommunicationThis skill lets an AI agent author, save, and edit email templates in the PostHog workflows library. It composes email design JSON with Liquid personalization and creates or round-trip-edits templates over MCP. Use it when you need to design, build, update, or fix an email template for workflows, broadcasts, or campaigns.
Use Designing email templates in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Designing email templates and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Designing email templates skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Have access to a PostHog project with the workflows library enabled.
What your AI can do with it
- Compose email design JSON with Liquid personalization
- Create templates in the PostHog workflows library
- Round-trip edit existing templates over MCP
- Upload images for use in email designs
- Add unsubscribe links and click-tracking controls
- Preview each template after saving
Getting started
- Have access to a PostHog project with the workflows library enabled.
- Configure an MCP connection that exposes the PostHog workflows API calls.
- Provide the agent with the email content, personalization fields, and any images to include.
- Ask the agent to create or update the template, then review the preview it returns.
What this skill tells your AI
The instructions your AI receives, as published by posthog/skills in skills/omnibus/designing-email-templates/SKILL.md and read by ahel’s review.
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.
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 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.
Images
Call media-images-list with purpose="email" first — reuse an existing image (a logo, a header banner) instead of uploading a duplicate.
To add a new image, upload it with the presigned flow rather than embedding bytes in the design:
media-image-upload-startwith the file's name andpurpose="email"— returnsid,upload_url, andform_fields.- From a shell, POST the local file to
upload_url:curl -X POST <upload_url> -F key=value... -F file=@/path/to/image.png(theform_fieldsfrom the response,filelast). Never base64-encode image bytes into a tool call — a flipped token corrupts the image. media-image-upload-completewith theid— returns the permanenturl.
Put that url in the image block's values.src.url (see references/unlayer-design-json.md). The block also takes values.src.width/height; the media tools don't return dimensions, so if you have shell access to the local file, measure it yourself rather than guessing.
Images must be under 4MB and decode as PNG, JPEG, GIF, WebP, AVIF or BMP.
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"
}
}
}
subjectis required for email templates.- Always author the
designand omithtml- 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
textas a real plain-text rendering of the message - clients that block rich content show onlytext, 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:
workflows-get-email-template— always fetch fresh; the returneddesignis the current source of truth.- Modify the
design(keep subject/text alongside it). workflows-update-email-template— send the completecontentback. The server re-renders the sent email from the edited design.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.
workflows-get— the step's current design (and its block ids) is inconfig.inputs.email.value.design.workflows-patch-action-emailwith the workflow id, the step'saction_id, and your operations and/oremail_patch.- The HTML is re-rendered server-side from the patched design, so it never goes stale.
- On an active workflow the edit stages a draft — test with
workflows-test-run(use_draft=true) and apply it withworkflows-publish.
Using templates
- List what exists with
workflows-list-email-templates(metadata only; fetch one for its content). - When the user asks to see a template, call
workflows-show-email-template— it renders an inline preview. - Reference a template from a workflow's
function_emailaction (its UUID inconfig.template_uuid), or start a broadcast from it in the PostHog UI. The step takes a snapshot of the template's body at save - editing the library template later does not change steps that already used it. To change a step's email, patch that step withworkflows-patch-action-email. - Templates are soft-deleted by setting
deleted: trueviaworkflows-update-email-template.
Signals
- GitHub stars
- 72
- Forks
- 7
- Last commit
- Oct 2026
Questions
- What kind of email templates does this skill work with?
- It works with templates for PostHog workflows, broadcasts, and campaigns. Templates are stored in the PostHog workflows library.
- Can it edit an existing template?
- Yes. It supports round-trip editing, so the agent can fetch a template, change its design JSON, and save the update back to the library.
- How does it handle images in email designs?
- It uses an upload flow to add images, then references them in the email design JSON.
- Does it add unsubscribe links and click tracking?
- Yes. The skill can add unsubscribe links and click-tracking controls to the template.
- Can I preview a template before using it?
- Yes. The skill previews each template after saving.
Advanced
- Item type
- skill
- Key
designing-email-templates- Source
- github.com/posthog/skills
Related picks
Skill · coreyhaines31
The pick for Adsnewsletter-monetization-planner
Skill · aaron-he-zhu
The pick for Newsletternewsletter-writer
Skill · cbrock84
The pick for Newslettersealeap-athena-commerce-copywriting
Skill · xjli360
The pick for Product Copygrounded-copy
Skill · hirohyun
The pick for Product Copygws-gmail
Skill · googleworkspace
The pick for Gmail