Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your Contact Form Says Thanks, Then Loses the Lead. Here Is a Next.js Handler That Cannot Drop One

Picture the failure mode that worries me most on a service business site. A homeowner fills out the contact form, clicks Submit, and sees a green "Thanks, we will be in touch." Behind that message, the handler called a third party email or form service, the call failed or got throttled, and nobody logged it. The owner sees an empty inbox and concludes the site is dead. The visitor waits for a…

In the world of service-based websites, there is one crucial piece of code that can make or break a potential lead: the contact form. Imagine a homeowner filling out the contact form, clicking the Submit button, and seeing a reassuring "Thanks, we will be in touch." message. However, behind the scenes, the handler called a third-party email or form service to process the submission.

Unfortunately, if the call to the email service fails or gets throttled, the lead is lost forever, with no trace left behind. This scenario is the worst kind of bug a developer can encounter, as it leaves both the owner and the visitor with false expectations. To prevent such a disaster, the recommended approach is to store the submission first and then attempt to notify anyone afterwards.

This change in order, rather than relying on a specific vendor, ensures that the lead is never lost silently. The handling process should begin by storing the submission in a durable storage system that the developer controls, before proceeding to notify the third-party service. This way, even if the email provider is down, slow, or throttled, the lead is still saved and can be retried later.

The HTTP 200 response sent to the browser should indicate that the submission has been successfully stored, and the notification side effect is allowed to fail independently. By storing the lead data first, developers can ensure that valuable leads are not lost silently, providing a crucial safeguard for service-based businesses.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Uniface 10 field triggers - leaveField compiles, but loseFocus is what runs

A customer app built in Uniface 10 got a quick entry form: while the user moves from field to field, the form tidies names, checks the e-mail address, fills in the city from the postal code and lists…

  • Uniface 10 renamed interactive field triggers
  • "leaveField" trigger replaced with "loseFocus"
  • Proper trigger names crucial for Uniface 10 functionality

What can happen after a payment platform already received your payout

A factual account of a USD 330 hold, what freelancers can do next, and why I built a small awareness site with open comments.

  • Freelance freelancer's USD 330 payout held after receipt by Skydo on Nov 13, 2026
  • Payment marked received but delayed due to routine due diligence checks on Nov 16
  • Additional document requests and delayed release keep payout held until Nov 17

How I Cut a Days-Long Malware-Scanning Build to Under an Hour

A build that used to take days of console work now takes one Terraform apply, in under an hour. And when the policy changes, it no longer means a rebuild.

  • Multi-day malware scanning reduced to under an hour using Terraform
  • GuardDuty Malware Protection scans new objects in landing bucket
  • Terraform module enables easy deployment in shared or individual enclave accounts

More from Monday 16 November →