Bolt email

Notification Emails Contain Broken Links in Bolt App

Users receive notification emails from your Bolt.new application (order confirmations, status updates, invitation links), but when they click the links, they land on 404 pages, localhost URLs, or completely wrong pages. The emails are being delivered but every link inside them is broken.

This destroys user trust immediately. A customer who receives an order confirmation with a broken tracking link, or a team member who gets an invitation email that leads to a 404, will question whether your entire application is legitimate. Broken email links are one of the most visible and damaging bugs.

The root cause is almost always that the URLs in email templates are hardcoded to your development environment or constructed incorrectly. Email templates are generated once and don't automatically update when your app URL changes from development to production.

Error Messages You Might See

404 Not Found: The page you're looking for doesn't exist ERR_CONNECTION_REFUSED (linking to localhost) This site can't be reached: localhost refused to connect Invalid URL: undefined/orders/123
404 Not Found: The page you're looking for doesn't existERR_CONNECTION_REFUSED (linking to localhost)This site can't be reached: localhost refused to connectInvalid URL: undefined/orders/123

Common Causes

  • Hardcoded localhost URLs — Email templates contain links like http://localhost:3000/orders/123 instead of using the production domain
  • Missing base URL environment variable — No APP_URL or NEXT_PUBLIC_SITE_URL configured, so link generation defaults to localhost
  • Dynamic route segments wrong — Links to /orders/[id] are rendered literally as /orders/[id] instead of /orders/abc123 with the actual ID
  • URL encoding issues — Special characters in query parameters or paths are not properly encoded, breaking the link
  • Trailing slash mismatch — Links include or exclude trailing slashes inconsistently, causing routing failures on the frontend

How to Fix It

  1. Set a base URL environment variable — Define APP_URL=https://yourapp.com in your environment and use it for all email link generation: const link = `${process.env.APP_URL}/orders/${orderId}`
  2. Create an email URL helper — Build a utility function: function emailUrl(path: string) { return new URL(path, process.env.APP_URL).toString(); } and use it everywhere in email templates
  3. Test emails with real link clicking — Don't just check that emails arrive - click every single link in your test emails to verify they resolve correctly
  4. Use absolute URLs always — Never use relative paths in emails (/orders/123). Always use full absolute URLs (https://yourapp.com/orders/123)
  5. Add link tracking — Use UTM parameters on email links so you can track click-through rates and quickly identify which links are broken

Real developers can help you.

Luca Liberati Luca Liberati I work on monoliths and microservices, backends and frontends, manage K8s clusters and love to design apps architecture Caio Rodrigues Caio Rodrigues I'm a full-stack developer focused on building practical and scalable web applications. My main experience is with **React, TypeScript, and modern frontend architectures**, where I prioritize clean code, component reusability, and maintainable project structures. I have strong experience working with **dynamic forms, state management (Redux / React Hook Form), and complex data-driven interfaces**. I enjoy solving real-world problems by turning ideas into reliable software that companies can actually use in their daily operations. Beyond coding, I care about **software quality and architecture**, following best practices for componentization, code organization, and performance optimization. I'm also comfortable working across the stack when needed, integrating APIs, handling business logic, and helping transform prototypes into production-ready systems. My goal is always to deliver solutions that are **simple, efficient, and genuinely useful for the people using them.** hanson1014 hanson1014 Full-stack developer experienced in fixing and deploying AI-generated apps from Lovable, Bolt.new, Cursor, and Replit. I specialize in debugging Supabase integration issues (auth flows, RLS policies, database connections), fixing broken deployments, resolving routing/blank screen problems, and cleaning up messy React/Vite codebases. I also build production apps with the Claude API and have shipped a Mac desktop dev tool (Nexterm from scratch. Based in Hong Kong, fast turnaround. Jen Jacobsen Jen Jacobsen I’m a Full-Stack Developer with over 10 years of experience building modern web and mobile applications. I enjoy working across the full product lifecycle — turning ideas into real, well-built products that are intuitive for users and scalable for businesses. I particularly enjoy building mobile apps, modern web platforms, and solving complex technical problems in a way that keeps systems clean, reliable, and easy to maintain. Taufan Taufan I’m a product-focused engineer and tech leader who builds scalable systems and turns ideas into production-ready platforms. Over the past years, I’ve worked across startups and fast-moving teams, leading backend architecture, improving system reliability, and shipping products used by thousands of users. My strength is not just writing code — but connecting product vision, technical execution, and business impact. Nam Tran Nam Tran 10 years as fullstack developer David Olverson David Olverson Solo dev shipping production apps with AI-assisted development. I specialize in rescuing broken Lovable/Bolt/Cursor builds and taking them to production. 10+ apps shipped including SaaS CRMs, gaming platforms, real estate tools, and Discord bots. Stack: Next.js 16, TypeScript, Tailwind CSS, FastAPI, PostgreSQL, Prisma. I use Claude Code with 50+ custom skills for rapid delivery. Average turnaround: 2-4 weeks from broken prototype to production. Jared Hasson Jared Hasson Full time lead founding dev at a cyber security saas startup, with 10 yoe and a bachelor's in CS. Building & debugging software products is what I've spent my time on for forever Bastien Labelle Bastien Labelle Full stack dev w/ 20+ years of experience Vlad Temian Vlad Temian 15+ years shipping production infrastructure for startups. Former CTO at qed.builders (acquired by The Sandbox). Cursor ambassador and agentic tooling builder. I've scaled systems, automated deployments, and built observability tools for AI coding workflows. I specialize in taking vibe-coded apps from broken prototype to production-ready: fixing Supabase auth/RLS, Stripe integrations, deployment pipelines, and cleaning up AI-generated spaghetti. I build tools in this space (agentprobe, claudebin, micode) and understand both sides: how AI generates code and why it breaks. https://blog.vtemian.com/

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help

Frequently Asked Questions

How do I make email links work in both development and production?

Use an environment variable for your base URL (APP_URL=http://localhost:3000 in dev, APP_URL=https://yourapp.com in production). Build all email links using this variable instead of hardcoding any domain.

How can I preview email templates before sending?

Create a preview route like /api/email-preview/order-confirmation that renders the email HTML in the browser. This lets you check formatting, links, and dynamic content without actually sending emails.

Related Bolt Issues

Can't fix it yourself?
Real developers can help.

You don't need to be technical. Just describe what's wrong and a verified developer will handle the rest.

Get Help