Email Template Builder
层级: 强大
类别: 工程团队
领域: 事务性邮件 / 通信基础设施
构建完整的事务性邮件系统:React Email 模板、供应商集成、预览服务器、国际化支持、深色模式、垃圾邮件优化和分析追踪。输出可用于生产的代码,支持 Resend、Postmark、SendGrid 或 AWS SES。
emails/
├── components/
│ ├── layout/
│ │ ├── email-layout.tsx # 带品牌页眉/页脚的基础布局
│ │ └── email-button.tsx # CTA 按钮组件
│ ├── partials/
│ │ ├── header.tsx
│ │ └── footer.tsx
├── templates/
│ ├── welcome.tsx
│ ├── verify-email.tsx
│ ├── password-reset.tsx
│ ├── invoice.tsx
│ ├── notification.tsx
│ └── weekly-digest.tsx
├── lib/
│ ├── send.ts # 统一发送函数
│ ├── providers/
│ │ ├── resend.ts
│ │ ├── postmark.ts
│ │ └── ses.ts
│ └── tracking.ts # UTM + 分析
├── i18n/
│ ├── en.ts
│ └── de.ts
└── preview/ # 开发预览服务器
└── server.ts
tsx
// emails/components/layout/email-layout.tsx
import {
Body, Container, Head, Html, Img, Preview, Section, Text, Hr, Font
} from @react-email/components
interface EmailLayoutProps {
preview: string
children: React.ReactNode
}
export function EmailLayout({ preview, children }: EmailLayoutProps) {
return (

{/ 内容 /}
{children}
{/ 页脚 /}
const styles = {
body: { backgroundColor: #f5f5f5, fontFamily: Inter, Arial, sans-serif },
container: { maxWidth: 600px, margin: 0 auto, backgroundColor: #ffffff, borderRadius: 8px, overflow: hidden },
header: { padding: 24px 32px, borderBottom: 1px solid #e5e5e5 },
content: { padding: 32px },
divider: { borderColor: #e5e5e5, margin: 0 32px },
footer: { padding: 24px 32px },
footerText: { fontSize: 12px, color: #6b7280, textAlign: center as const, margin: 4px 0 },
link: { color: #6b7280, textDecoration: underline },
}
tsx
// emails/templates/welcome.tsx
import { Button, Heading, Text } from @react-email/components
import { EmailLayout } from ../components/layout/email-layout
interface WelcomeEmailProps {
name: string
confirmUrl: string
trialDays?: number
}
export function WelcomeEmail({ name, confirmUrl, trialDays = 14 }: WelcomeEmailProps) {
return (
我们很高兴您加入。您有 {trialDays} 天时间探索 MyApp 提供的所有功能——无需信用卡。
首先,确认您的邮箱地址以激活账户:
按钮无法使用?复制并粘贴此链接到浏览器:
{confirmUrl}
确认后,您可以:
)
}
export default WelcomeEmail
const styles = {
h1: { fontSize: 28px, fontWeight: 700, color: #111827, margin: 0 0 16px },
text: { fontSize: 16px, lineHeight: 1.6, color: #374151, margin: 0 0 16px },
button: { backgroundColor: #4f46e5, color: #ffffff, borderRadius: 6px, fontSize: 16px, fontWeight: 600, padding: 12px 24px, textDecoration: none, display: inline-block, margin: 8px 0 24px },
hint: { fontSize: 13px, color: #6b7280 },
link: { color: #4f46e5 },
list: { fontSize: 16px, lineHeight: 1.8, color: #374151, paddingLeft: 20px },
}
tsx
// emails/templates/invoice.tsx
import { Row, Column, Section, Heading, Text, Hr, Button } from @react-email/components
import { EmailLayout } from ../components/layout/email-layout
interface InvoiceItem { description: string; amount: number }
interface InvoiceEmailProps {
name: string
invoiceNumber: string
invoiceDate: string
dueDate: string
items: InvoiceItem[]
total: number
currency: string
downloadUrl: string
}
export function InvoiceEmail({ name, invoiceNumber, invoiceDate, dueDate, items, total, currency = USD, downloadUrl }: InvoiceEmailProps
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 email-template-builder-1776176180 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 email-template-builder-1776176180 技能
skillhub install email-template-builder-1776176180
文件大小: 5.61 KB | 发布时间: 2026-4-15 12:58