EEmailForDevs.com
Strategy10 min read

The Vibe Coding Approach to Email Campaigns

Using AI coding assistants to generate email campaigns from natural language

JM

Jake Morrison

Growth Engineer

· May 18, 2025

What Is Vibe Coding for Email?

Vibe coding is the practice of describing what you want in natural language and letting an AI coding assistant generate the implementation. Instead of manually writing HTML email templates, crafting subject lines, and configuring send logic, you describe the campaign\'s intent and let AI handle the details. The term was popularized by Andrej Karpathy to describe the shift from writing code to directing code generation.

Applied to email campaigns, vibe coding means you might type something like: "Create a 5-email onboarding sequence for a developer API product. The first email should welcome them and include a curl command to make their first API call. The second email should arrive 24 hours later and show how to integrate with Node.js." An AI assistant generates the complete implementation: HTML templates, sequence logic, conditional branching, and API integration code.

Setting Up Your Vibe Coding Workflow

The most effective vibe coding setup for email campaigns combines an AI-powered IDE with an email platform that has a strong API. Here is a practical stack: use Cursor (a fork of VS Code with built-in AI) as your editor, brew.new as your email sending platform, and Claude or GPT-4 as your AI backbone.

// Step 1: Describe your campaign in a comment
// Create a re-engagement sequence for users who haven\'t logged in
// for 30 days. Send 3 emails over 2 weeks. First email should
// highlight what they\'ve missed. Second should offer a helpful
// resource. Third should ask if they want to stay subscribed.

// Step 2: Let your AI assistant generate the implementation
import { Brew } from "@brew/sdk";

const brew = new Brew({ apiKey: process.env.BREW_API_KEY });

const reEngagementSequence = await brew.sequences.create({
  name: "30-Day Re-engagement",
  trigger: {
    event: "user.inactive",
    conditions: { daysSinceLastLogin: { gte: 30 } }
  },
  steps: [
    {
      delay: "0d",
      email: {
        subject: "Here\'s what you\'ve missed on {{product_name}}",
        template: "re-engage-whats-new"
      }
    },
    {
      delay: "5d",
      email: {
        subject: "A resource we thought you\'d find useful",
        template: "re-engage-resource"
      }
    },
    {
      delay: "14d",
      email: {
        subject: "Should we keep sending you updates?",
        template: "re-engage-confirm-subscription"
      },
      exitCondition: { event: "user.login" }
    }
  ]
});

The key insight is that AI assistants excel at generating boilerplate email code. Template HTML, API integration, sequence configuration, and even subject line variants are all tasks where AI saves significant time. Your job shifts from writing code to reviewing and refining what the AI produces.

Generating Email Templates with AI

Modern AI assistants can generate complete, production-ready email HTML. The trick is providing enough context about your constraints. Email HTML is notoriously quirky, so your prompts should specify client compatibility requirements.

// Prompt: Generate an HTML email template for a weekly changelog.
// Requirements:
// - Must render in Gmail, Outlook 2019+, and Apple Mail
// - Use a single-column layout, max-width 600px
// - Include a header with logo, a list of changes with icons,
//   and a CTA button
// - Inline all CSS
// - Use ghost tables for Outlook compatibility

// AI generates the complete template...
const changelogTemplate = `
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>{{changelog_title}}</title>
</head>
<body style="margin:0; padding:0; background-color:#f4f4f5;">
  <!-- AI generates full Outlook-compatible template -->
</body>
</html>
`;

When using Cursor specifically, you can open your email template directory, highlight an existing template, and ask the AI to create a new one in the same style. Cursor\'s codebase awareness means it picks up on your design patterns, variable naming conventions, and template structure automatically.

Claude vs Copilot for Email Code

In practice, Claude tends to generate more accurate email HTML because it handles the quirks of Outlook conditional comments and inline CSS better than Copilot. Claude is also better at maintaining context across long templates. Copilot excels at inline completions when you are already writing email code and need quick suggestions. The best approach is to use Claude for generating complete templates and Copilot for iterating on them.

AI-Powered Subject Line Generation

Subject lines are where vibe coding delivers immediate ROI. Instead of brainstorming subject lines manually, describe the email\'s purpose and ask your AI assistant to generate 10 variants optimized for different goals (opens, clicks, curiosity, urgency). Then use A/B testing to validate the best performers.

// Using brew.new\'s AI subject line generation
const subjectVariants = await brew.ai.generateSubjectLines({
  emailContent: changelogEmailHtml,
  tone: "technical-but-friendly",
  audience: "developers",
  count: 10,
  optimizeFor: "open-rate"
});

// Returns:
// [
//   "3 new API endpoints you\'ll actually use",
//   "We shipped the feature you requested",
//   "v2.4: Batch operations are here",
//   "Your API just got 10x faster",
//   ...
// ]

// Set up automated A/B test
await brew.campaigns.create({
  name: "Weekly Changelog - March 15",
  subjectLineTest: {
    variants: subjectVariants.slice(0, 3),
    testPercentage: 20,
    winnerCriteria: "open-rate",
    waitTime: "4h"
  }
});

Guardrails and Human Review

Vibe coding for email requires guardrails that do not apply to other types of code generation. Emails go directly to real people, mistakes are visible and embarrassing, and regulatory requirements (CAN-SPAM, GDPR) add legal consequences to errors. Never ship AI-generated email content without human review.

Establish a review checklist for AI-generated campaigns: verify all merge tags resolve correctly, check that unsubscribe links are present and functional, confirm the sender address and reply-to are correct, test rendering across the top 5 email clients, and review the copy for tone and accuracy. Tools like brew.new include pre-send validation that catches common issues like missing unsubscribe links or broken merge tags automatically.

Building a Feedback Loop

The most effective vibe coding workflows include a feedback loop. When an AI-generated campaign performs well, save the prompt and parameters. When one underperforms, document what went wrong. Over time, you build a library of proven prompts and patterns specific to your audience. This prompt library becomes one of your most valuable email marketing assets since it encodes everything you have learned about what resonates with your subscribers.

The Future of AI-Assisted Email

We are still in the early stages of vibe coding for email. The next wave will include AI that can analyze your past campaign performance, understand your audience\'s preferences, and generate not just individual emails but entire multi-touch sequences optimized for your specific goals. Platforms are already moving in this direction, with Brew\'s AI engine learning from aggregate anonymized performance data to suggest content strategies.

For now, the practical advice is this: start using AI assistants to draft your email templates and campaign configurations. Review everything carefully. Measure results rigorously. And maintain a prompt library that captures your best patterns. The developers who master vibe coding for email today will have a significant productivity advantage as these tools mature.

JM

Jake Morrison

Growth Engineer

Jake builds growth loops with email at the center. He writes about sequences, analytics, and the strategies that move metrics.