Use this pre-built prompt to get started faster.
Prerequisites
To get the most out of this guide, you’ll need to:- Create an API key
- Verify your domain
- Install Encore (
brew install encoredev/tap/encore)
1. Create an Encore app
The quickest way to get started is with the Resend starter template:2. Set your API key
Encore has built-in secrets management. Store your Resend API key as a secret - no.env files needed:
email/resend.ts
3. Define a service
Every Encore.ts service needs a service definition file:email/encore.service.ts
4. Send email using an API endpoint
Create a type-safe API endpoint to send emails:email/send.ts
5. Async delivery with Pub/Sub (optional)
For production, use Encore’s built-in Pub/Sub to send emails asynchronously with automatic retries:email/topic.ts
6. Run the app
http://localhost:4000. Send a test email:
7. AI skills for Encore.ts
If you’re using an AI coding assistant, install the Encore skills for context-aware help with APIs, services, Pub/Sub, databases, auth, and more:8. Try it yourself
Resend Starter
Full example with Pub/Sub email delivery
Encore.ts Docs
Encore.ts documentation