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.

MFox MFox Full-stack professional senior engineer (15+years). Extensive experience in software development, qa, and IP networking. prajwalfullstack prajwalfullstack Hi Im a full stack developer, a vibe coded MVP to Market ready product, I'm here to help Luca Liberati Luca Liberati I work on monoliths and microservices, backends and frontends, manage K8s clusters and love to design apps architecture Alvin Voo Alvin Voo I’ve watched the tech landscape evolve over the last decade—from the structured days of Java Server Pages to the current "wild west" of Agentic-driven development. While AI can "vibe" a frontend into existence, I specialize in the architecture that keeps it from collapsing. My expertise lies in the critical backend infrastructure: the parts that must be fast, secure, and scalable. I thrive on high-pressure environments, such as when I had only three weeks to architect and launch an Ethereum redemption system with minimal prior crypto knowledge, turning it into a major revenue stream. What I bring to your project: Forensic Debugging: I don't just "patch" bugs; I use tools like Datadog and Explain Analyzers to map out bottlenecks and resolve root causes—like significantly reducing memory usage by optimizing complex DB joins. Full-Stack Context: Deep experience in Node.js and React, ensuring backends play perfectly with mobile and web teams. Sanity in the Age of AI: I bridge the gap between "best practices" and modern speed, ensuring your project isn't just built fast, but built to last. Sage Fulcher Sage Fulcher Hey I'm Sage! Im a Boston area software engineer who grew up in South Florida. Ive worked at a ton of cool places like a telehealth kidney care startup that took part in a billion dollar merger (Cricket health/Interwell health), a boutique design agency where I got to work on a ton of exciting startups including a photography education app, a collegiate Esports league and more (Philosophie), a data analytics as a service startup in Cambridge (MA) as well as at Phillips and MIT Lincoln Lab where I designed and developed novel network security visualizations and analytics. I've been writing code and furiously devoted to using computers to make people’s lives easier for about 17 years. My degree is in making computers make pretty lights and sounds. Outside of work I love hip hop, the Celtics, professional wrestling, magic the gathering, photography, drumming, and guitars (both making and playing them) Omar Faruk Omar Faruk As a Product Engineer at Klasio, I contributed to end-to-end product development, focusing on scalability, performance, and user experience. My work spanned building and refining core features, developing dynamic website templates, integrating secure and reliable payment gateways, and optimizing the overall system architecture. I played a key role in creating a scalable and maintainable platform to support educators and learners globally. I'm enthusiastic about embracing new challenges and making meaningful contributions. Kingsley Omage Kingsley Omage Fullstack software engineer passionate about AI Agents, blockchain, LLMs. Stanislav Prigodich Stanislav Prigodich 15+ years building iOS and web apps at startups and enterprise companies. I want to use that experience to help builders ship real products - when something breaks, I'm here to fix it. Jaime Orts-Caroff Jaime Orts-Caroff I'm a Senior Android developer, open to work in various fields 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

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