Payment Integration

Stripe + Unosend

Send payment confirmation emails, invoices, and subscription notifications with Unosend and Stripe webhooks.

Features

Everything you need to send emails from Stripe

Webhook event handling

Payment confirmation emails

Invoice notifications

Subscription updates

Receipt generation

Quick Start

Get up and running in minutes with this code example

Code Example
// Handle Stripe webhook events
import { Unosend } from '@unosend/node';
import Stripe from 'stripe';

const unosend = new Unosend(process.env.UNOSEND_API_KEY);
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);

async function handleWebhook(event: Stripe.Event) {
  switch (event.type) {
    case 'payment_intent.succeeded':
      const payment = event.data.object as Stripe.PaymentIntent;
      await unosend.emails.send({
        from: 'billing@yourdomain.com',
        to: payment.receipt_email!,
        subject: 'Payment Confirmed',
        html: `
          <h1>Thank you for your payment!</h1>
          <p>Amount: ${(payment.amount / 100).toFixed(2)}</p>
          <p>Payment ID: ${payment.id}</p>
        `,
      });
      break;

    case 'invoice.paid':
      const invoice = event.data.object as Stripe.Invoice;
      await unosend.emails.send({
        from: 'billing@yourdomain.com',
        to: invoice.customer_email!,
        subject: 'Invoice Paid',
        html: `<p>Your invoice ${invoice.number} has been paid.</p>`,
      });
      break;
  }
}

Setup Guide

Follow these steps to integrate Unosend with Stripe

1

Set up Stripe webhook endpoint

2

Configure webhook events (payment_intent.succeeded, invoice.paid, etc.)

3

Install @unosend/node and stripe packages

4

Handle events and send appropriate emails

Why Use Unosend with Stripe?

Automated payment notifications

Custom branded receipts

Real-time subscription updates

Professional invoice emails

Ready to integrate?

Start sending emails from Stripe in under 5 minutes. Free tier includes 5,000 emails/month.