Use this pre-built prompt to get started faster.
Prerequisites
Before you start, you’ll need:- A Resend API key
- A verified domain
Guide
Install an SSR adapter
Because Astro builds a static site by default, install an SSR adapter to enable on-demand rendering of routes.
Add your API key
Create an API key in Resend and add it to your
.env file to keep your API key secret..env
Send email using HTML
Create an Astro Action under Call the
actions/index.ts.The easiest way to send an email is with the html parameter.send action from any frontmatter route, script, or component.Examples
Send Email
Basic email sending
Attachments
Send emails with file attachments
Inline Images (CID)
Embed inline images using CID
Templates
Send emails using Resend hosted templates
Scheduling
Schedule emails for future delivery
Audiences
Manage contacts and audiences
Domains
Create and manage sending domains
Webhooks
Handle webhook events