Sending Email
Every real app sends email sooner or later. Confirmations, password resets, receipts, digests, notifications. The agent scaffolds Resend by default. It installs the SDK, writes the templates, and wires the send routes. Your Resend account stays in your name - you connect it once in Dashboard → Connectors → Resend, and every project in your account can send through it.
Why Resend
- Generous free tier and clean to set up.
- Good deliverability out of the box. Meaning your emails actually land in inboxes, not spam.
- Easy domain verification (the bit where you prove "yes, I really own myapp.com").
- React-based email templates the agent can edit like any other screen.
If you're already on SendGrid, Postmark, or Mailgun, the agent can wire those up best-effort if you ask. They're not managed connectors, though - no encrypted key storage, no activity log - so it will ask you for a brand-new, minimum-permission key, keep it server-side rather than in the app, and suggest rotating anything you had to share during setup.
The setup prompt
"Send a welcome email when a new user verifies their email. Keep it short and friendly. Use Resend, and send it from hello@myapp.com."
The agent:
- Installs the Resend SDK.
- Creates a React email template (
emails/welcome.tsx). - Wires up an API route at
/api/email/welcomethat renders the template and sends via Resend. - Triggers the email on the appropriate Supabase event (post-verify).
- Sends through your connected Resend account - the API key stays encrypted on our side and is never bundled into your app.
- Reminds you to verify your sending domain in Resend.
Domain setup (do this before users arrive)
Before your first real email goes out, verify your sending domain. This is the step that proves to Gmail and Apple Mail that your emails really are from you. Without it, your emails land in spam.
- In the Resend dashboard, add your domain (e.g.,
myapp.com). - Resend gives you three small "DNS records". Entries you add to your domain's settings (wherever you bought the domain).
- Wait 1-24 hours for those settings to propagate around the internet.
- Click "Verify" in the Resend dashboard.
With Account Access turned on for the Resend connector, the agent can add the domain to Resend for you - you still paste the DNS records into your domain settings yourself. Everything it does in your account shows up in the Activity feed on the connector page.
Don't skip this. Emails from unverified domains land in spam.
Tip: use a subdomain like mail.myapp.com instead of the bare myapp.com. If something ever goes wrong with email deliverability, it won't affect your main domain.
Email templates
Resend supports React-based email templates (via react-email), which compile to HTML that works across every major client. The agent writes these for you:
// emails/welcome.tsx
export function WelcomeEmail({ name }: { name: string }) {
return (
<Html>
<Body style={{ fontFamily: "system-ui", padding: 24 }}>
<Heading>Welcome, {name}</Heading>
<Text>Thanks for creating an account. Here's how to get started...</Text>
<Button href="https://myapp.com/start">Get started</Button>
</Body>
</Html>
);
}You can preview every template locally with npx react-email dev.
Common email flows
Welcome email
Triggered on email verification. Short, warm, one clear CTA.
Password reset
Appsanic wires this up automatically when you enable email + password auth. See Authentication.
Magic link log-in
For passwordless auth. Also automatic; you can customize the template.
Receipt / confirmation
For any transaction. Include order number, itemized amount, and support contact.
Weekly digest
A batched email summarizing activity. Usually a scheduled function that runs once a week, queries the database for the user's recent activity, and sends a digest to each active user.
"Send each user a weekly digest every Monday morning summarizing their habit streak, any new comments on their posts, and their progress toward goals."
Transactional but sensitive
For account changes: password change confirmations, new device alerts, data deletion confirmations. Short, factual, no marketing content.
From-address best practices
- Use a from address on your verified domain. Never send from Gmail/Outlook for transactional email.
- Use different addresses for different types of mail:
hello@myapp.com. Welcome, onboarding.notifications@myapp.com. Activity, digests.security@myapp.com. Security alerts, password resets.billing@myapp.com. Receipts, subscription events.- Set a Reply-To if replies should go somewhere other than your From. For example,
Reply-To: support@myapp.com.
Unsubscribe handling
If you send anything that isn't strictly transactional, you need an unsubscribe link. The agent handles this for digest and marketing emails:
- Adds a List-Unsubscribe header (Gmail and Apple Mail respect this; it creates a native "Unsubscribe" button).
- Stores unsubscribe state in the user profile.
- Suppresses future non-essential email to anyone who unsubscribed.
Transactional email (password reset, billing receipt) can legally go without unsubscribe in most jurisdictions, but digests, promotions, and product marketing require it.
Inbound email (receiving email)
Resend can receive mail too, so the agent can turn an incoming email into an action in your app.
"When a user emails support@myapp.com, create a support ticket in our Supabase database and send an auto-reply acknowledging receipt."
Ask for it and the agent wires the inbound route; you add one DNS MX record pointing to Resend.
Rate limits
Resend's free tier sends a few thousand emails a month with a daily cap, and paid plans scale from there - check their pricing page for current numbers. Add your own throttle on top: cap any digest at once per 24 hours per user.
Testing
Before sending to real users:
- Use Resend's test mode (sends land in a sandbox inbox, not real inboxes).
- Or send to your own address first. Check in multiple clients (Gmail web, Apple Mail on iPhone, Outlook on Windows). What looks good in one can break in another.
What to watch
- Spam complaints. Resend tells you when a user marks your email as spam. Investigate if the rate rises. Usually means you're over-sending or sending to people who didn't expect it.
- Bounces. Hard bounces (invalid address) should auto-suppress. Resend handles this by default.
- Domain reputation. New domains have low sending reputation. Warm up gradually: don't blast to 10,000 addresses on day one.
Next
Read Maps & Location for location-aware features.
