Skip to content

Conversation

@zackproser
Copy link
Owner

@zackproser zackproser commented Oct 21, 2025

Note

Adds a full Resend-powered newsletter system (DB models, APIs, webhooks, scripts, email template) and a mobile-friendly admin UI with AI content expansion.

  • Backend/API:
    • Adds Newsletter admin endpoints: create, list, [id]/expand, [id]/preview, [id]/send, [id]/stats, and [id] delete.
    • Implements Resend webhook handler (email.sent/delivered/opened/clicked/bounced, contact.created/deleted) updating analytics/subscriptions.
  • Database (Prisma):
    • Introduces Newsletter, NewsletterSubscription, and NewsletterExpansion models with analytics fields and indexes.
  • Admin UI (mobile-friendly):
    • New page /admin/newsletter with components: CreateNewsletterModal (voice input), NewsletterCard, PreviewModal, StatsModal.
  • Email Rendering:
    • React Email template NewsletterTemplate and mdx-to-html utility for converting MDX to email-safe HTML.
  • Scripts:
    • scripts/newsletter/export-emailoctopus-contacts.ts (CSV export + DB sync) and import-to-resend.ts (batched import to Resend + DB update).
  • Dependencies:
    • Adds resend, @anthropic-ai/sdk, @react-email/*, @react-email/render, marked, and related rehype/lockfile updates.
  • Docs:
    • Adds implementation progress, migration guides, and roadmap markdown files.

Written by Cursor Bugbot for commit 285bace. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Oct 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
portfolio Error Error Oct 21, 2025 5:57am

💡 Enable Vercel Agent with $100 free credit for automated AI reviews

console.log('🤖 Calling Claude for content expansion...')

const response = await anthropic.messages.create({
model: 'claude-sonnet-4-20250514',
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Invalid Model Name with Future Date

The Anthropic model name claude-sonnet-4-20250514 is invalid. It uses a future date and doesn't align with Anthropic's typical naming conventions, which will cause API calls to fail.

Fix in Cursor Fix in Web

bulletPoints: newsletter.bulletPoints,
expandedContent,
model: 'claude-sonnet-4',
tokensUsed: response.usage.output_tokens
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Model Name Mismatch Causes Tracking Errors

The model name recorded in the database (claude-sonnet-4) is inconsistent with the actual model used in the Anthropic API call (claude-sonnet-4-20250514). This leads to inaccurate tracking of the specific AI model that generated the content.

Fix in Cursor Fix in Web

<Text style={footerText}>
<Link href="{{{RESEND_UNSUBSCRIBE_URL}}}" style={unsubscribeLink}>
Unsubscribe
</Link>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Unsubscribe Link Syntax Error

The unsubscribe link in NewsletterTemplate.tsx uses {{{RESEND_UNSUBSCRIBE_URL}}}. This syntax isn't recognized by Resend's templating system (which expects {{unsubscribe_url}}), causing the literal string to render in the email. This prevents users from unsubscribing.

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants