StoicBuilder

HandbookII the ForumSending email

IIthe Forum, The shape of an app

Sending email

1 min readUpdated 28 November

In plain words

Transactional email is the one-to-one email your app sends because someone did something, like signing up or ordering, delivered through a service such as Resend or Postmark.

Where you see it

QuickBite's "Your order is on its way", a Guildhall invite, or Supabase's "Confirm your signup" message. Behind each one is a call to an email service, plus a few DNS records proving you're allowed to send from your domain.

lib/email.tsserver
const resend = new Resend(process.env.RESEND_API_KEY); await resend.emails.send({ from: "QuickBite <orders@quickbite.example>", to: order.email, subject: `Order ${order.id} confirmed`, html: "<p>Your food is being prepared.</p>",});
The from address must be on a domain you've verified with the provider, or the email won't go out.

What goes wrong

  1. Skipping the DNS records

    Your provider asks you to add records called SPF, DKIM and DMARC that prove the email really comes from you. Skip them and receipts land in spam or disappear.

  2. Launching on Supabase's built-in sender

    The default email service in Supabase is meant for testing and has a very low hourly limit. Connect your own provider before real users sign up.

  3. Letting a failed email fail the order

    If the email call throws, the customer sees an error even though the order went through. Save first, send after, and log failures instead of undoing the order.

What to tell your agent

Copy this into Lovable, Bolt, Cursor or any agent
Send this app's emails through a provider such as Resend or Postmark from a verified domain, and list the DNS records I need to add. Log and retry any email that fails, and never let a failed email stop the user's action from completing.

Quick check

Sign in to earn +10 XP for it

QuickBite's order confirmations land in spam for Gmail users. What's the likely cause?

Got a prompt that touches sending email?

Paste it. You get a better prompt first, then the cards that explain it.

Check your own prompt

Free, no sign-up.