designing-email-templates
它能做什么
这项技能让智能体在 PostHog 的工作流库中设计邮件模板。适合希望制作精美邮件、并在邮件中展示每位读者个人信息的营销人员和产品团队。
适用场景
- ✓当你想为营销活动或工作流创建新的邮件模板的时候。
- ✓当你想编辑或修复 PostHog 中现有邮件模板的时候。
- ✓当你希望邮件中出现个人信息(例如名字)的时候。
技能链接
https://github.com/PostHog/posthog/blob/master/products/workflows/skills/designing-email-templates/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请为新用户设计一个欢迎邮件模板,顶部放上我的标志,问候语中使用他们的名字。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会以结构化格式编写模板设计,PostHog 会将其转换为可编辑的邮件。它使用 Liquid 占位符来填充个人信息,并分享一个链接,方便你在 PostHog 中打开该模板。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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.
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.)
A template written for Customer.io can keep its {% unsubscribe_url %} tag, which renders the same link as {{ unsubscribe_url }}.
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;. - For HTML your own backend builds, such as a summary list, add
| raw:{{ variables.summary_html | raw }}. Never userawon text a person typed. - Format money with
currency:{{ variables.amount | currency: "USD" }}renders$1,234.50. A value that isn't a number renders unchanged.
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": ["…"], "values": { "preheaderText": "Three short
常见问题
智能体创建后,我还能编辑模板吗?
可以。模板会以可编辑的模块形式在 PostHog 中打开,人们可以在那里修改。
什么是 Liquid 标签?
它们是占位符,例如名字,在发送邮件时会根据每位读者的信息自动填入。
智能体会选择设计风格吗?
会。它的指导要求它在编写版式之前先确定清晰的设计方向,使邮件看起来有明确的意图。
详情
作者的原始描述
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.
repo: PostHog/posthog
热度
- GitHub 星标
- 41k
- 排名
- #6981
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
depot-ci
41k帮你的智能体设置并运行 Depot CI 工作流(GitHub Actions 的替代方案),包括迁移现有工作流和读取运行日志。
depot-container-builds
41k帮你的智能体在 Depot 的远程构建器上构建 Docker 镜像,包括多平台镜像、推送到镜像仓库,以及修复构建失败。
depot-github-runners
41k帮你的智能体把 GitHub Actions 任务迁移到 Depot 托管的运行器上,选择运行器规格和标签,并排查运行器设置问题。
editing-agents-md
41k帮你的智能体判断某条规则应写入 AGENTS.md 还是 CLAUDE.md,并以不会让文件臃肿的方式写下,确保规则真正生效。