Skip to main content
Spree handles two categories of emails:

Customer-Facing Emails (Headless)

In headless builds, customer-facing emails are rendered and sent by the storefront, not the backend. The Spree backend publishes webhook events, and the storefront receives them, renders React email templates, and sends via Resend (or any provider).

Setup

  1. Create a webhook endpoint in Spree Admin → Settings → Developers → Webhooks:
    • URL: https://your-storefront.com/api/webhooks/spree
    • Events: order.completed, order.canceled, order.shipped, customer.password_reset_requested, newsletter_subscriber.subscription_requested
  2. Configure the storefront with the webhook secret and email provider:
  1. The storefront handles everything else — signature verification, event routing, email rendering, and delivery are built in. See the Next.js storefront email docs for template customization.

Supported Events

Custom Frameworks

If you’re not using the Next.js storefront, you can build your own webhook handler with any framework. Use @spree/sdk/webhooks for signature verification:
See Webhooks documentation for the full payload format and verification details.

System Emails (Rails)

System emails are internal notifications sent to store staff, not customers. They are sent by the Spree backend via Rails ActionMailer.

Configuration

Set the following environment variables on the Spree backend to enable system email delivery: When SMTP_HOST is not set, emails are printed to the Rails log instead of being sent.

Provider Examples

Remember to verify the email address in SendGrid you intend to use for sending, otherwise emails will be rejected. Read more about sender verification.

Local Development

Customer-facing emails (storefront)

In development, no email provider is needed. Emails are rendered to HTML files in .next/emails/ with a clickable file:// link in the console. To preview and design templates:
To test the full webhook flow locally, use Cloudflare Tunnel:
Use the tunnel URL as the webhook endpoint URL in Spree Admin.

System emails (Rails)

System emails use letter_opener in development — emails open automatically in your browser instead of being sent.