Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.95 KB

File metadata and controls

54 lines (37 loc) · 1.95 KB

Resend + Encore Starter

Send transactional emails with Resend and Encore. Emails are delivered asynchronously via Pub/Sub so your API endpoints stay fast.

Deploy to Encore

What's included

  • Resend SDK initialized with an Encore secret
  • Pub/Sub topic for async email delivery with automatic retries
  • Send endpoint that publishes email events and returns immediately
  • Frontend at / with a form to send test emails

Prerequisites

You'll need a Resend account:

  1. Create an API key. Go to API Keys and create a new key.
  2. Verify a domain (optional for testing). Go to Domains to add your sending domain. Until you verify a domain, the example uses onboarding@resend.dev as the default sender, which works with any Resend API key.

Get started

  1. Install Encore if you haven't already:

    curl -L https://encore.dev/install.sh | bash
  2. Create a new app from this example:

    encore app create --example=ts/resend
  3. Set your Resend API key:

    encore secret set --type local ResendAPIKey
  4. Run the app:

    encore run
  5. Open http://localhost:4000 to send a test email.

Customizing the sender address

The example defaults to onboarding@resend.dev (Resend's built-in test sender). To use your own address, verify your domain in Resend and update the from field in email/topic.ts.

Learn more