DEV Community

Solomon
Solomon

Posted on

I Built a Free Email Writer Ai — No Signup, No Subscription

I got tired of staring at a blank compose window. Every time I needed to write a professional email — a client follow-up, a pitch, a status update — I'd spend 20 minutes drafting, deleting, rewriting, and second-guessing. So I built something to fix that: Email Writer AI, a zero-friction tool that generates polished email drafts from a one-line description.

Try it live right now: https://email-writer-ai.solomontools.workers.dev

No signup. No subscription wall. No API key. You type what you need, pick a tone, and get a draft in seconds.

Why I Built It

This isn't a side project I abandoned after a weekend. I use it daily. When I need to write a client proposal follow-up or a vendor escalation, I open the tool, type something like "polite follow-up about the delayed shipment, keep it firm but friendly," and I get a ready-to-send draft. It saves me roughly 15 minutes every time I use it — that compounds to hours a week.

I wanted it to be the simplest possible tool: no accounts, no persistent storage, no data collection. You type, it writes, you copy and go. That's it.

The Architecture

The entire app runs on Cloudflare Workers at the edge. There's no server, no database, no backend infrastructure to manage. The HTML page is served as a static asset from a Worker KV namespace, and every email generation request hits the worker's fetch handler, which routes to an AI inference endpoint.

Here's the core request handler:

addEventListener('fetch', (event) => {
  event.respondWith(handleRequest(event.request));
});

async function handleRequest(request) {
  const url = new URL(request.url);

  if (url.pathname === '/generate' && request.method === 'POST') {
    const { topic, tone } = await request.json();

    const prompt = `Write a professional email about "${topic}". Tone: ${tone}. Keep it concise, clear, and ready to send. Do not include filler or disclaimers.`;

    const response = await fetch(
      'https://api.cloudflare.com/client/v4/accounts/' + ACCOUNT_ID + '/ai/run/@cf/meta/llama-3-8b-instruct',
      {
        method: 'POST',
        headers: {
          'Authorization': `Bearer ${AI_API_TOKEN}`,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({ prompt }),
      }
    );

    const data = await response.json();
    return new Response(JSON.stringify({ email: data.result.response }), {
      headers: { 'Content-Type': 'application/json' },
    });
  }

  // Serve the static HTML page for everything else
  const asset = await ASSETS.get(url.pathname === '/' ? 'index.html' : url.pathname.slice(1));
  return new Response(asset, { headers: { 'Content-Type': 'text/html' } });
}
Enter fullscreen mode Exit fullscreen mode

The client side is a single HTML file with vanilla JavaScript — no framework, no build step, no bundler. I served it directly from the Worker. When the user clicks "Generate," a fetch call posts the topic and tone to /generate, and the response streams back as JSON. The result is injected into a textarea the user can edit and copy.

Why Cloudflare Workers

I considered a few options. A traditional server on a VPS would work, but I didn't want to manage uptime, scaling, or SSL. Vercel or Netlify would handle the frontend fine, but I didn't want to pay for a platform when the edge already had everything I needed.

Cloudflare Workers gave me:

  • Edge execution — the AI inference call happens close to the user, reducing latency.
  • No cold starts — Workers spin up instantly, which matters for a tool people open expecting instant results.
  • KV for static assets — I store the HTML, CSS, and JS in a KV namespace and serve them directly. One deployment, zero infrastructure.
  • AI integration — Cloudflare's AI Gateway routes to hosted models (I use Llama 3 8B Instruct via @cf/meta) without me managing any GPU infrastructure.

What I Learned Shipping This

Keep the frontend stupid. The entire UI is 200 lines of HTML and CSS. No React, no Vue, no hydration dance. The user doesn't care about your frontend architecture — they care about speed and result quality.

Prompt engineering matters more than model size. I tried a smaller model first and the emails sounded robotic. Tweaking the prompt — adding "concise," "ready to send," and explicitly saying "do not include filler" — dramatically improved output quality without changing the model.

Free tiers have limits. Cloudflare's AI API has rate limits and usage caps. I set a reasonable request size limit and cache common tone+topic combinations in KV for a short TTL. This keeps costs near zero while maintaining decent response times.

The hardest part is the UX around the output. Making the textarea editable by default, pre-selecting the generated text so the user can immediately copy it — these small details matter more than the AI model itself.

Monetization (Honest)

Email Writer AI is free to use. There's no paywall, no credit system, and no forced sign-up. It costs me a small amount in inference tokens each month, but it's well within the free tier allowances.

The project page at the root domain includes a one-time $5 option if you use the tool and find it saves you time. That's it. No monthly fee, no "premium tier," no feature gating. If it helps you, you can chip in once. If it doesn't, keep using it for free — I don't care either way.

What's Next

I'm considering adding a few features based on actual usage patterns:

  • Tone presets — instead of free-text tone input, quick buttons like "Professional," "Friendly," "Direct."
  • Subject line generation — auto-suggest a subject line alongside the email body.
  • Multi-language support — detect the input language and generate in the same language.

But honestly? The current version works well enough that I use it every day. That's the best validation a tool can get.

If you find it useful, drop it a bookmark. If you want to build something similar, the entire stack is simpler than you think — a Worker, a KV namespace, and an AI model call. Ship it.


Enjoyed this? I build simple, powerful AI tools — try the free Text Summarizer or browse the full toolkit at Solomon Tools. No signup, no subscription.

Top comments (0)