executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
html-email-builder生成兼容 Gmail/Outlook 等主流邮件客户端 HTML Newsletter,使用 table 布局和 inline CSS 确保渲染一致,支持单栏、双栏、Hero Banner、内容摘要等多种版式。当用户需要制作公司周报、产品公告、营销邮件、活动邀请函或内容摘要邮件,或提及 Newsletter、HTML 邮件、邮件模板、兼容 Outlook 等关键词时触发。
Independent GitHub snapshot · Automated classification · Original documentation governs
生成专业的 HTML 邮件 Newsletter,完全兼容 Gmail、Outlook、Apple Mail 等主流邮件客户端。采用 table 布局 + inline CSS 方案,确保在所有客户端中渲染一致。
layout 字段是一个语义标签,用于标注邮件的用途类型,帮助你选择合适的 section 组合。实际的邮件结构由 sections 数组中的模块类型决定。
| 布局标签 | 推荐的 section 组合 | 适用场景 |
|---|---|---|
single-column | hero_banner + text + cta | 通用 Newsletter、公告 |
two-column | two_column + image_text | 产品对比、图文并排 |
hero | hero_banner + text + cta | 营销邮件、活动邀请 |
digest | 多个 article_card | 内容摘要、文章推荐 |
| 模块类型 | 说明 |
|---|---|
hero_banner | 全宽 Banner 大图,可叠加标题文字 |
text | 纯文本段落,支持标题 |
image_text | 图文混排(图片+文字并排) |
cta | 行动号召按钮 |
divider | 分隔线 |
quote | 引用块 |
article_card | 文章卡片(图+标题+摘要+链接) |
two_column | 双栏内容区域 |
向用户了解以下信息:
根据用户需求,创建 JSON 配置文件。配置格式如下:
{
"layout": "single-column",
"theme": {
"primary_color": "#2563EB",
"secondary_color": "#1E40AF",
"accent_color": "#F59E0B",
"bg_color": "#F3F4F6",
"content_bg_color": "#FFFFFF",
"text_color": "#1F2937",
"muted_text_color": "#6B7280",
"font_family": "Arial, Helvetica, sans-serif",
"max_width": 600
},
"header": {
"logo_url": "",
"logo_alt": "Company",
"title": "Newsletter Title",
"subtitle": ""
},
"preheader": "邮件预览文本,显示在收件箱列表中",
"sections": [
{
"type": "text",
"title": "Section Title",
"body": "Section content in HTML or plain text."
}
],
"footer": {
"company": "Company Name",
"address": "Company Address",
"unsubscribe_url": "#",
"extra_links": [
{"text": "Website", "url": "#"}
]
}
}
将配置写入临时 JSON 文件,然后运行生成脚本:
python scripts/generate_newsletter.py --input config.json --output newsletter.html
{
"type": "hero_banner",
"image_url": "https://example.com/hero.jpg",
"title": "Welcome to Our Newsletter",
"subtitle": "Monthly updates and insights",
"overlay_color": "rgba(0,0,0,0.4)"
}
{
"type": "text",
"title": "Section Heading",
"body": "Paragraph content. Supports <b>bold</b>, <i>italic</i>, <a href='#'>links</a>."
}
{
"type": "image_text",
"image_url": "https://example.com/photo.jpg",
"image_alt": "Description",
"image_position": "left",
"title": "Feature Title",
"body": "Feature description text.",
"cta_text": "Learn More",
"cta_url": "#"
}
{
"type": "cta",
"text": "Get Started Now",
"url": "#",
"align": "center"
}
{
"type": "divider",
"color": "#E5E7EB",
"spacing": 20
}
{
"type": "quote",
"text": "This is a quoted text block.",
"author": "Author Name"
}
{
"type": "article_card",
"image_url": "https://example.com/thumb.jpg",
"title": "Article Title",
"excerpt": "Brief summary of the article...",
"url": "#",
"cta_text": "Read More"
}
{
"type": "two_column",
"left": {
"title": "Left Column",
"body": "Left content"
},
"right": {
"title": "Right Column",
"body": "Right content"
}
}
生成的 HTML 遵循以下邮件兼容性最佳实践:
<table> 而非 <div>,确保 Outlook 兼容style 属性内联,避免 <style> 标签被邮件客户端剥离bgcolor 属性和 background-color 样式https://placehold.co/600x300/EEE/333?text=Your+Image 作为占位图