Question: Why an outbox instead of calling the email provider inside the transaction?
Answer: An HTTP call inside a transaction holds a pool connection while it waits on the network. The outbox breaks that into three steps: a short transaction that claims the row, a send with no lock at all, and a short transaction that records the result. The Idempotency-Key is the row id, so a resend after a crash is a no-op.
