Recipe: Stripe payment → receipt email
After a successful Stripe payment, send a receipt with Notify.
Trigger: Stripe webhook confirms payment. Action: send a receipt via Notify.
Steps
- Handle
checkout.session.completed(orinvoice.paid) on your server - Load line items / amount for the customer email
- Send with Notify
// Inside your Stripe webhook handler after verifying the signature
const email = session.customer_details?.email;
if (!email) return;
await fetch('https://notify.cx/api/email/send', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': process.env.NOTIFY_API_KEY!
},
body: JSON.stringify({
to: email,
subject: `Receipt — ${session.id}`,
from: 'billing@your-verified-domain.com',
message: `<p>Thanks for your payment of <strong>${(session.amount_total! / 100).toFixed(2)} ${session.currency?.toUpperCase()}</strong>.</p>`
})
});
Gate on a receipt_sent_at column so retries do not duplicate mail.