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.

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. Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. Simon A. Simon A. I'm a backend developer building APIs, emulators, and interactive game systems. Professionally, I've developed Java/Spring reporting solutions, managed relational and NoSQL databases, and implemented CI/CD workflows. 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.** Basel Issmail Basel Issmail ’m a Senior Full-Stack Developer and Tech Lead with experience designing and building scalable web platforms. I work across the full development lifecycle, from translating business requirements into technical architecture to delivering reliable production systems. My work focuses on modern web technologies, including TypeScript, Angular, Node.js, and cloud-based architectures. I enjoy solving complex technical problems and helping teams turn product ideas and prototypes into working platforms that can grow and scale. In addition to development, I often collaborate closely with product managers, business analysts, designers, and QA teams to ensure that solutions align with both technical and business goals. I enjoy working with startups and product teams where I can contribute both as a hands-on engineer and as a technical partner in designing and delivering impactful software. Costea Adrian Costea Adrian Embedded Engineer specilizing in perception systems. Latest project was a adas camera calibration system. 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. MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. Mehdi Ben Haddou Mehdi Ben Haddou - Founder of Chessigma (1M+ users) & many small projects - ex Founding Engineer @Uplane (YC F25) - ex Software Engineer @Amazon and @Booking.com 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.

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