An order confirmation email tells a customer, seconds after checkout, that their order went through and what happens next. It is one of the most opened emails a store sends, and customers search their inbox for it when something goes wrong. It needs the order details, a way to get help, and reliable delivery exactly once per order.
What to include
| Section | Contents |
|---|---|
| Headline | “Thanks, your order is confirmed” and the order number |
| Items | Name, variant, quantity and price for each line |
| Totals | Subtotal, shipping, tax, discounts, total charged |
| Payment | Card brand and last four digits, or the method used |
| Delivery | Shipping address and method, expected dispatch or delivery window |
| Next steps | “We will email you a tracking link when it ships” |
| Help | A Reply-To that reaches support, plus a link to the order page |
Never include full card numbers, and avoid putting passwords or account recovery links in an order email.
When to send it
Send the email when payment is confirmed on the server, usually in the payment provider’s webhook handler. Do not rely on the browser landing on a “thank you” page: customers close the tab, and bots load it. Payment webhooks can be delivered more than once, so the send must be idempotent.
Best practices
- Order number in the subject. “Order 1042 confirmed” is searchable.
- Plain, structured layout. A table of items reads well in every client. Keep the HTML light; huge image-heavy emails are slow and clip in some clients.
- Text version too. For accessibility and for filters.
- Reply-To support. Customers reply to order emails. Make sure someone reads them, or route them into your help desk with inbound email.
- Separate from marketing. Keep promotions minimal. Under the US CAN-SPAM Act, the primary purpose of the message decides whether it is commercial, per the FTC guide.
- Same domain as your store. Links and From address on the domain customers know.
Order confirmation email template
From: Acme Store <orders@acme.com>
Reply-To: support@acme.com
Subject: Order 1042 confirmed
Hi Sam, thanks for your order.
Order 1042, placed 16 November 2026
Linen shirt, blue, M x1 $48.00
Canvas tote x2 $30.00
Shipping (standard) $5.00
Tax $6.64
Total charged (Visa 4242) $89.64
Shipping to:
Sam Buyer, 12 Example Road, Springfield
We will email a tracking link when your order ships, usually within 2 working days.
Questions? Reply to this email or visit https://acme.com/orders/1042
Sending it with Mailcandor
This handler runs after your payment provider confirms the charge. It sends through the Mailcandor email API with an Idempotency-Key of order-1042-confirmation: if the webhook fires twice, or your code retries after a timeout, the second request returns the first response and no second email goes out.
const money = (cents) => `$${(cents / 100).toFixed(2)}`;
const esc = (s) => String(s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' })[c]);
export async function sendOrderConfirmation(order) {
const rows = order.items.map((i) =>
`<tr><td>${esc(i.name)}</td><td>x${i.qty}</td><td align="right">${money(i.totalCents)}</td></tr>`).join('');
const textRows = order.items.map((i) => `${i.name} x${i.qty} ${money(i.totalCents)}`).join('\n');
const res = await fetch('https://api.mailcandor.com/v1/emails', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.MAILCANDOR_KEY}`,
'Content-Type': 'application/json',
'Idempotency-Key': `order-${order.number}-confirmation`,
},
body: JSON.stringify({
from: 'Acme Store <orders@acme.com>',
to: order.customer.email,
reply_to: 'support@acme.com',
subject: `Order ${order.number} confirmed`,
html: `<p>Hi ${esc(order.customer.firstName)}, thanks for your order.</p>
<table>${rows}<tr><td colspan="2"><b>Total</b></td><td align="right"><b>${money(order.totalCents)}</b></td></tr></table>
<p>We will email a tracking link when it ships.</p>
<p><a href="https://acme.com/orders/${order.number}">View your order</a></p>`,
text: `Order ${order.number} confirmed\n\n${textRows}\nTotal ${money(order.totalCents)}\n\nView your order: https://acme.com/orders/${order.number}`,
tags: [{ name: 'type', value: 'order_confirmation' }],
}),
});
if (!res.ok) {
const { error } = await res.json();
throw new Error(`${error.type}: ${error.message}`);
}
return (await res.json()).id; // store it on the order
}
Escape customer-supplied text, like names and gift messages, before putting it in HTML. Store the returned email id on the order. When a customer says “I never got it”, you can look the email up and see whether it was delivered or bounced, with the bounce explained in plain English. Webhooks tell you as it happens.
If you already use the SendGrid or Postmark send call in your store, Mailcandor accepts those request shapes too, though their stored templates are not supported, so send rendered HTML. See switching from SendGrid or from Postmark.
The emails that follow
The confirmation starts a short series, each sent when something real happens:
- Shipped, with the carrier and tracking link, from your fulfillment webhook.
- Delayed, if dispatch slips past the window you promised. Customers forgive a delay they hear about first.
- Delivered, optionally, with a link to report a problem.
- Refunded or canceled, with the amount and when it will appear.
Use the same From address and the order number in every subject, so the series threads together in most inboxes. A review request a few days after delivery is closer to marketing; send it only where your customers agreed to it.
Common pitfalls
- Sending from the browser redirect. Some customers never reach it; others reload it.
- No idempotency. Duplicate payment webhooks mean duplicate emails and confused customers.
- A no-reply address. Customers reply anyway. Give them a mailbox that someone reads.
- Sending from a free email domain.
acmestore@gmail.comfails DMARC when sent through any service. Use your own domain. - Huge HTML. Inline images and bloated templates slow loading and can get clipped. Link to the order page for detail.
- Mixing in heavy promotions. It can change how the email is classified and annoy customers who only wanted their receipt.