diff --git a/apps/website/emails/drip-whitepaper-followup.ts b/apps/website/emails/drip-whitepaper-followup.ts index 7fcd5dbf0..dc45d4e91 100644 --- a/apps/website/emails/drip-whitepaper-followup.ts +++ b/apps/website/emails/drip-whitepaper-followup.ts @@ -1,52 +1,66 @@ -export function dripWhitepaperFollowupHtml(day: number): { subject: string; html: string } { - const unsubUrl = 'https://stream-resource.dev/api/unsubscribe'; +import { wrapEmail } from './email-wrapper'; +export function dripWhitepaperFollowupHtml(day: number): { subject: string; html: string } { if (day === 2) { return { subject: 'Did you get a chance to read Chapter 3?', - html: wrapEmail(` -
Chapter 3 covers tool-call rendering — how to surface agent actions as real UI instead of raw JSON. It's the chapter most teams bookmark first.
-If you haven't downloaded it yet, grab it here.
- `), + html: wrapEmail({ + body: ` +Whitepaper Follow-up
+Did you get a chance to read Chapter 3?
+Chapter 3 covers tool-call rendering — how to surface agent actions as real UI instead of raw JSON. It's the chapter most teams bookmark first.
+ Read the Guide → + `, + showUnsubscribe: true, + }), }; } + if (day === 5) { return { subject: 'The gap between demo and production', - html: wrapEmail(` -Half of GenAI projects die after proof of concept. The gap isn't the model — it's the frontend production path: streaming state, thread persistence, human approval flows, and deterministic testing.
-That's exactly what the Angular Agent Framework solves. See how it works →
- `), + html: wrapEmail({ + body: ` +Production Readiness
+The gap between demo and production
+Half of GenAI projects die after proof of concept. The gap isn't the model — it's the frontend production path: streaming state, thread persistence, human approval flows, and deterministic testing.
+ See How It Works → + `, + showUnsubscribe: true, + }), }; } + if (day === 10) { return { subject: 'The pilot program is included with every app license', - html: wrapEmail(` -Every app deployment license includes a 3-month co-pilot engagement — we work alongside your Angular team to ship your first agent to production.
-Week 1: Integration & first stream
Month 1: First agent in staging
Month 3: Production deployment
Learn about the pilot program →
- `), + html: wrapEmail({ + body: ` +Pilot Program
+The pilot program is included with every app license
+Every app deployment license includes a 3-month co-pilot engagement — we work alongside your Angular team to ship your first agent to production.
+Week 1 · Integration & first stream
+Month 1 · First agent in staging
+Month 3 · Production deployment
+If your team is evaluating how to take an Angular + LangGraph agent to production, I'd love to hear what you're building.
-Reply to this email or schedule a conversation — no pitch, just a technical discussion about your use case.
- `), + subject: "Ready to ship your agent? Let's talk.", + html: wrapEmail({ + body: ` +Let's Connect
+Ready to ship your agent? Let's talk.
+If your team is evaluating how to take an Angular + LangGraph agent to production, I'd love to hear what you're building. Reply to this email or schedule a conversation — no pitch, just a technical discussion about your use case.
+ `, + showUnsubscribe: true, + }), }; } - -function wrapEmail(body: string): string { - return ` - -Angular Agent Framework
- ${body} -Angular Agent Framework — Signal-native streaming for LangGraph.
- -New Lead
-${esc(name)}
-${esc(email)}${company ? ` — ${esc(company)}` : ''}
- ${message ? `${esc(message)}
` : ''} -Received ${esc(ts)}
-New Lead
+${esc(name)}
+${esc(email)}${company ? ` — ${esc(company)}` : ''}
+ ${message ? `${esc(message)}
Received ${esc(ts)}
+Angular Agent Framework
-Welcome to Angular Agent Framework updates
-You'll receive updates on new capabilities, production patterns, and Angular agent best practices. We keep it focused and infrequent — no spam.
- Explore the Docs -Angular Agent Framework — Signal-native streaming for LangGraph.
-Welcome to Angular Agent Framework updates
+You'll receive updates on new capabilities, production patterns, and Angular agent best practices. We keep it focused and infrequent — no spam.
+ Explore the Docs + `, + }); } diff --git a/apps/website/emails/whitepaper-download.ts b/apps/website/emails/whitepaper-download.ts index c57487368..4c0141b40 100644 --- a/apps/website/emails/whitepaper-download.ts +++ b/apps/website/emails/whitepaper-download.ts @@ -1,20 +1,15 @@ +import { wrapEmail, esc } from './email-wrapper'; + const DOWNLOAD_URL = 'https://stream-resource.dev/whitepaper.pdf'; export function whitepaperDownloadHtml(name?: string): string { - return ` - -Angular Agent Framework
-Your Angular Agent Readiness Guide
-${name ? `Hi ${esc(name)}, t` : 'T'}he guide covers six production-readiness dimensions: streaming state, thread persistence, tool-call rendering, human approval flows, generative UI, and deterministic testing.
- -Angular Agent Framework — Signal-native streaming for LangGraph.
-Your Angular Agent Readiness Guide
+${name ? `Hi ${esc(name)}, t` : 'T'}he guide covers six production-readiness dimensions: streaming state, thread persistence, tool-call rendering, human approval flows, generative UI, and deterministic testing.
+ + `, + }); } diff --git a/apps/website/src/app/api/email-preview/route.ts b/apps/website/src/app/api/email-preview/route.ts new file mode 100644 index 000000000..ca2f5f712 --- /dev/null +++ b/apps/website/src/app/api/email-preview/route.ts @@ -0,0 +1,81 @@ +/** + * Dev-only email template preview route. + * Visit /api/email-preview?template=whitepaper-download to preview a template. + * Available templates: whitepaper-download, newsletter-welcome, lead-notification, + * drip-day-2, drip-day-5, drip-day-10, drip-day-20 + */ +import { NextRequest, NextResponse } from 'next/server'; +import { whitepaperDownloadHtml } from '../../../../emails/whitepaper-download'; +import { newsletterWelcomeHtml } from '../../../../emails/newsletter-welcome'; +import { leadNotificationHtml } from '../../../../emails/lead-notification'; +import { dripWhitepaperFollowupHtml } from '../../../../emails/drip-whitepaper-followup'; + +const TEMPLATES: RecordClick a template to preview it as rendered HTML.
+ ${links} + `, + { headers: { 'Content-Type': 'text/html' } } + ); + } + + const factory = TEMPLATES[template]; + if (!factory) { + return new NextResponse(`Unknown template: ${template}`, { status: 404 }); + } + + const { subject, html } = factory(); + + // Wrap in a preview frame showing subject line + const preview = `