Order confirmation email sent on state transition to confirmed
Why it matters
A customer who pays for an order and receives no confirmation email has no evidence that the transaction occurred. From their perspective, they may have been charged without a successful order — leading to chargebacks, duplicated purchases, and unnecessary support contacts. This is an iso-25010:2011 reliability failure: the system accepted a payment but failed to complete its contractual obligation to the customer. The confirmation email is also the canonical moment to surface the order number, line items, and delivery estimate — omitting it makes every subsequent customer question ('where is my order?') harder to handle.
Severity rationale
Critical because failing to send a confirmation email after a successful payment leaves customers with no proof of purchase and no reference number, directly causing chargebacks and support escalations.
Remediation
Add a confirmation email trigger in your payment webhook handler at app/api/webhooks/stripe/route.ts, fired immediately after the order transitions to 'confirmed'.
import { sendOrderConfirmationEmail } from '@/lib/email/order-emails'
case 'checkout.session.completed': {
const order = await db.orders.findFirst({
where: { stripeSessionId: event.data.object.id },
include: { items: true, user: true },
})
await transitionOrder(order.id, 'confirmed', 'system', 'Payment received')
await sendOrderConfirmationEmail({
to: order.user.email,
orderNumber: order.id,
items: order.items,
total: order.total,
})
break
}
If you use a job queue like BullMQ or Inngest, enqueue the email as a job rather than awaiting it inline to keep webhook response times under 5 seconds.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Order Management Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · reliability — Reliability — fault tolerance / notification delivery
Taxons
History
- 2026-04-18·v1.0.0·Initial import from ecommerce-order-management·automated