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. 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. Matthew Butler Matthew Butler Systems Development Engineer @ Amazon Web Services Rudra Bhikadiya Rudra Bhikadiya I build and fix web apps across Next.js, Node.js, and DBs. Comfortable jumping into messy code, broken APIs, and mysterious bugs. If your project works in theory but not in reality, I help close that gap. 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.** Jacek Rozanski Jacek Rozanski Senior PHP/Symfony developer and DevOps engineer with 20+ years of professional experience, running opcode.pl (web development agency, est. 2004). Day job: I'm the sole backend developer at merketing company where I own and maintain 11 PHP/Symfony microservices on AWS (ECS Fargate, RDS, S3, CloudFront), handle the full CI/CD pipeline (Bitbucket Pipelines, Docker), and manage monitoring with Sentry and CloudWatch. These services handle high request volumes in production every month. What I bring to AI-built apps: - I audit and fix security issues (OWASP methodology), performance bottlenecks, and architectural problems in codebases generated by Cursor, Claude Code, Lovable, Bolt, and v0 - I refactor AI-generated prototypes into production-grade applications with proper error handling, testing, and clean architecture (SOLID, DDD, hexagonal architecture) - I set up the infrastructure AI tools don't touch: AWS hosting, CI/CD pipelines, automated deployments, database optimization, monitoring, and alerting - I integrate external services: payment providers, email systems, partner APIs, SSO/auth Tech stack: PHP 8.x, Symfony, React, Next.js, PostgreSQL, MySQL, Docker, AWS (ECS, RDS, S3, SQS/SNS, CloudFront), Terraform, Supabase. I also use AI tools daily (Claude Code, Cursor) in my own workflow, so I understand both the strengths and the gaps in AI-generated code. Based in Poland (CET timezone). Available for async work and calls during EU/US business hours. Richard McSorley Richard McSorley Full-Stack Software Engineer with 8+ years building high-performance applications for enterprise clients. Shipped production systems at Walmart (4,000+ stores), Cigna (20M+ users), and Arkansas Blue Cross. 5 patents in retail/supply chain tech. Currently focused on AI integrations, automation tools, and TypeScript-first architectures. rayush33 rayush33 JavaScript (React.js, React Native, Node.js) Developer with demonstrated industry experience of 4+ years, actively looking for opportunities to hone my skills as well as help small-scale business owners with solutions to technical problems Dor Yaloz Dor Yaloz SW engineer with 6+ years of experience, I worked with React/Node/Python did projects with React+Capacitor.js for ios Supabase expert 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

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