Skip to main content

Wasp now supports Resend for sending emails

· 3 min read
Matija Sosic
Co-founder & CEO @ Wasp

Wasp 0.25 adds Resend as a first-class email sender provider, right next to Mailgun, SendGrid, and SMTP. Set provider: "Resend", add your API key, and you're sending emails. Big thanks to community contributor Jamie Davenport, who built the whole thing!

Why Resend

Resend has quickly become one of the most loved email APIs among developers, and it's easy to see why: a clean API, a generous free tier, and great DX around domain setup and debugging. It's also the team behind React Email, so it fits naturally into the React + Node.js world Wasp lives in.

It's been one of our most requested integrations for a while. You could already use Resend with Wasp over SMTP, but now it's a first-class provider: no SMTP credentials, no extra packages, just the official Resend SDK wired in for you.

How to use it

Set the provider to Resend in your main.wasp.ts file:

main.wasp.ts
import { app } from "@wasp.sh/spec"

export default app({
name: "myApp",
emailSender: {
provider: "Resend",
defaultFrom: {
name: "Example",
},
},
// ...
})

Then grab an API key from the Resend dashboard and add it to your .env.server file:

.env.server
RESEND_API_KEY=

That's the whole setup. Now you can send emails from anywhere on the server:

src/actions/sendEmail.ts
import { emailSender } from "wasp/server/email";

// In some action handler...
const info = await emailSender.send({
subject: "Saying hello",
text: "Hello world",
html: "Hello <strong>world</strong>",
});

And since emailSender is what Wasp uses under the hood for everything email-related, this also covers your email authentication flows - verification emails and password resets now go through Resend too, with zero extra code.

As with all Wasp providers, switching is a one-line change. Started on SMTP and want to move to Resend (or the other way around)? Change the provider field, swap the env variables, and everything else keeps working.

Built by the community

This feature was contributed by Jamie Davenport, who took it from idea to merged PR (#4381): the provider implementation, env variable validation, and docs. This is exactly the kind of contribution that makes open source fun - thanks, Jamie! 🙏

If you'd like to see your name here next time, check out our contributing guide or come say hi on Discord - we're always happy to help you find a good first issue.

Try it out

Resend support is live in Wasp 0.25. If you're not on it yet, update your Wasp CLI:

npm i -g @wasp.sh/wasp-cli

Then set provider: "Resend", add your API key, and send your first email. Check out the email sending docs for the full reference.

We'd love to hear how it works for you - come chat with us on Discord!

Discord

Join our developer community

Wasp is 100% open source. Join our Discord to learn from others and get help whenever you need it!

Join our Discord 👾
📫

Subscribe to our newsletter

Once per month - receive useful blog posts and Wasp news.