Email & Resend

Integrations & Backend · 40 articles

Add email capabilities with Resend

Sign up at Resend and verify your domain (DNS: TXT, MX records). Store your Resend API key in Supabase Secrets. Lovable can generate transactional email Edge Functions for confirmations, password resets, and notifications.

Are authentication emails the same as transactional emails?

Yes, authentication emails are a subset of transactional emails. Both are triggered by user actions and contain no marketing. Transactional email includes auth emails plus notifications (order confirmations, receipts, alerts). Keep all transactional emails professional, focused, and fast-responding. Avoid promotional content in transactional categories.

Avoid spam-trigger formatting

Avoid excessive capitalization, multiple exclamation marks, spam-trigger words, or aggressive formatting. Don't use URL shorteners or redirect links unnecessarily. Keep HTML clean and images minimal. Spam filters analyze content; suspicious formatting is a red flag. Write professionally and keep formatting simple.

Build a Simple CRM with Resend

Combine Supabase, Resend, and Lovable to build a lightweight CRM with automated email notifications, contact management, and email tracking.

Can I customize the email templates?

Yes, you can customize email templates using React Email or by building custom HTML in your Edge Functions. Lovable auto-generates template components you can modify. Define templates in your Edge Function code, then customize styling, branding, and content. Use variables for dynamic content like confirmation links and user names.

Can I schedule or automate email flows in Resend?

Resend itself doesn't schedule emails, but you can automate via Supabase Edge Functions + Cron Jobs or n8n workflows. For example, trigger a welcome email 1 hour after signup, or send digest emails daily. Lovable works well with n8n (via n8n MCP integration) to build complex email automation workflows.

Can I send marketing emails?

Lovable and Resend are optimized for transactional and authentication emails, not marketing campaigns. For marketing/broadcast emails, use a dedicated tool like Resend's Broadcast feature (with proper consent and unsubscribe links) or platforms like Mailchimp. Ensure compliance with CAN-SPAM and GDPR regulations.

Can I set up double opt-in for newsletters?

Yes, implement double opt-in by: 1) User subscribes via your form, 2) Resend sends a confirmation email with a unique link, 3) User clicks the link, 4) Your Edge Function marks them as confirmed in the database. This approach ensures subscribers actually want emails and improves deliverability. Lovable can scaffold this flow.

Can I use emails on the free plan?

Yes, you can set up and test emails on the free plan with Resend's free tier (up to 3,000 emails/month from a verified domain). However, Lovable Cloud deployment is required for production email, which may have platform-specific considerations. Test thoroughly before going live. Contact [email protected] for free plan limitations.

Do I need a custom web domain to use an email domain?

No, you don't need a custom web domain to use an email domain. Email and web domains are separate. You can have your app on xxx.lovable.app while sending emails from your verified custom domain (e.g., [email protected]). Email domain setup is independent of web domain setup.

Do I need a paid Resend plan to follow this tutorial?

No, you can start with Resend's free tier (verified custom domain, up to 3,000 contacts). To send emails via Resend in Lovable, sign up at Resend, verify your custom domain with DNS records, store your API key in Supabase secrets, and prompt Lovable to add the email functionality. For higher volume or advanced features, upgrade to a paid plan.

Do I need an external email provider like SendGrid or Resend?

Yes, for production email sending, you need an external email provider like Resend, SendGrid, or Mailgun. Lovable doesn't provide built-in email sending; it integrates with these providers via Supabase Edge Functions. Resend is the recommended choice and has generous free tier limits (3,000 verified emails/month).

Does Google authentication replace email/password sign-in?

No, Google authentication and email/password sign-in are independent methods. You can offer both in the same app—users can choose which way to sign in. Enable both in Supabase Authentication → Providers, and Lovable can scaffold both a 'Sign in with Google' button and an email/password form when you ask.

Does Resend support marketing emails or only transactional?

Resend supports both transactional emails (confirmations, resets, notifications) and marketing emails via Broadcast. Broadcasts let you send to large subscriber lists with analytics. However, comply with laws like GDPR and CAN-SPAM—always include unsubscribe options and respect user preferences.

Email not returned

If an email address isn't being returned in your Lovable app, verify that Supabase Auth is correctly configured and that the email column exists in your user table. Check that your authentication flow is saving the email in the correct field. Use Plan mode to investigate whether the issue is in the database query, auth setup, or UI binding.

Emails are not sending

Verify Resend API key is correctly configured and hasn't expired. Check that your email domain is verified (SPF, DKIM, DMARC records set). Ensure the 'From' address uses your verified domain. In Lovable, confirm Edge Functions are deployed via the Cloud tab. Check Resend dashboard for API errors or limits. Contact [email protected] if unsure.

Encourage positive engagement signals

Positive engagement (opens, clicks, replies) improves your sender reputation with inbox providers. Write compelling subject lines, valuable content, and clear CTAs. Remove inactive subscribers periodically. High engagement signals to providers that recipients want your emails, improving deliverability.

High bounce rates in analytics

High bounce rates indicate your email list contains invalid or inactive addresses. Verify addresses before sending. Remove hard bounces immediately. Check that you're not sending to old or incorrect email addresses. If using signups, require confirmed email addresses. Clean your list regularly and avoid re-adding bounced addresses.

How do I manage newsletter subscribers in Resend?

Store subscriber lists in your Supabase database (emails, preferences, subscription status). Use Edge Functions to handle subscribe/unsubscribe requests. Resend can pull from this data when sending broadcasts, or you can manage lists directly in Resend's dashboard. For a full tutorial, prompt Lovable to "Add newsletter signup with Resend integration."

How do I verify a domain in Resend?

In Resend, go to your sender domain settings and add DNS records (TXT, MX) that Resend provides. Update your DNS provider with these records. Resend will automatically detect verification once DNS propagation completes (usually within minutes to a few hours). After verification, you can send from your custom domain instead of the resend.dev test domain.

How does Resend handle unsubscribes?

Resend includes List-Unsubscribe headers in emails automatically, letting users unsubscribe with one click. When users unsubscribe, Resend logs it in your dashboard. You should also store unsubscribe preferences in your Supabase database and check before sending. This dual approach (Resend + database) ensures compliance and respects user preferences.

How many authentication emails are included per month?

Lovable doesn't set a limit on authentication emails; it depends on your Resend plan. Resend free tier allows up to 3,000 emails per month from a verified domain. Paid plans offer higher limits. Monitor your usage in Resend's dashboard. Once you hit the limit, emails may be queued or rejected; upgrade to increase capacity.

If emails land in spam

Check SPF, DKIM, and DMARC records are correctly configured and verified. Review email content for spam triggers (excessive links, images, etc.). Ensure your domain has warmed up gradually over weeks. Ask a few recipients to mark your email as 'Not Spam' to rebuild reputation. Contact Resend support if issues persist.

Keep authentication emails strictly transactional

Authentication emails (password resets, 2FA codes, account confirmations) must be purely transactional with no marketing content. Remove promotional text, upsells, or images unrelated to the auth action. This keeps your sender reputation high and improves deliverability. Keep subject lines clear and focused.

Limit internal testing

Don't send test emails to your own inbox repeatedly; inbox providers track this. Instead, use Resend's built-in testing tools or test with a small internal group once. Repetitive opens and clicks from the same address signal to filters that real users aren't engaging, lowering your sender score.

Maintain consistent sender identity

Always send emails from the same 'From' address and use consistent branding. Switching sender addresses or domain frequently harms reputation. Set your verified domain in Resend, then use it consistently across all email types. Inconsistent sender identity confuses recipients and triggers spam filters.

Monitor bounce rates and complaints

Regularly check your email analytics in Resend for bounce rates and complaint/spam reports. High bounce rates indicate bad email lists; remove bounced addresses immediately. Complaints mean recipients marked you as spam; this harms your domain reputation. Keep bounce and complaint rates below 2%.

My email template changes are not showing

Check that you've redeployed your Edge Functions after template changes via the Cloud tab → Deploy. Template updates are live once deployed. Clear your browser cache and refresh. Verify you're using the updated template variable in your email sending function. For Resend, ensure the email component correctly references the new template.

Send only legitimate, user-triggered emails

Only send emails in response to user actions (signups, password resets, notifications). Avoid bulk promotional emails or system-generated messages without user context. Inbox providers track engagement; emails that lack user triggers are more likely flagged as spam. Every email should have a clear purpose.

Test emails are landing in spam

Check domain authentication: SPF, DKIM, and DMARC records must be correctly configured. Ensure your domain has been warmed up by sending small volumes first. Avoid sending identical test emails repeatedly; vary subject lines and content. If still landing in spam, ask test recipients to mark as 'Not Spam' and wait for reputation to improve.

Understanding inbox provider algorithms

Gmail, Outlook, and Yahoo use algorithms to filter spam based on sender reputation, content, authentication (SPF/DKIM/DMARC), and user engagement. These algorithms learn from individual user behavior. Building a strong sender reputation through authentication, engagement, and gradual volume increases ensures emails reach inboxes reliably.

Use external tools to investigate deliverability issues

Use tools like MXToolbox (DNS/MX checks), Mail-tester.com (email quality score), or Google's Postmaster Tools to diagnose deliverability issues. These tools check authentication records, sender reputation, and content quality. GmailPostmasterTools provides insights into Gmail-specific delivery metrics. Review results and follow recommendations.

Warm up new domains gradually

When using a new email domain, gradually increase send volume over the first 2-4 weeks to build sender reputation with inbox providers. Start with a small test group, then expand. Avoid sending large batches immediately. This helps prevent your domain from being flagged as spam. Monitor bounce rates and adjust send volume accordingly.

What are SPF, DKIM, and DMARC, and do I need to configure them?

SPF, DKIM, and DMARC are DNS-based authentication protocols that prove you own the domain and authorize email sending. SPF lists authorized senders; DKIM signs emails cryptographically; DMARC defines domain policy. All three are required for best deliverability. Resend provides the exact records to add to your DNS provider.

What are authentication emails in Lovable?

Authentication emails are transactional messages sent during signup, password resets, or 2FA flows. Lovable and Resend handle these automatically. They contain no marketing content and are purely functional (confirmation links, codes, etc.). These are distinct from promotional emails and subject to different best practices.

What happens if I delete an email domain?

Deleting an email domain disconnects it from Lovable and revokes its Resend configuration. Email sending from that domain stops immediately. Users won't receive emails. You must reconfigure a new domain or use an existing one to resume email sending. Ensure you don't accidentally delete a domain in use.

What happens if I disable emails?

If you disable emails in your project settings, email sending stops immediately. Existing email Edge Functions remain in your code but won't send. You can re-enable anytime. Users won't receive confirmation emails, password resets, or other transactional messages. Disable only if you're planning to remove email functionality entirely.

What is Resend?

Resend is a transactional email service that integrates with Supabase Edge Functions to send emails from your Lovable app. It supports confirmation emails, password resets, notifications, and marketing broadcasts. Resend handles delivery, tracking, and compliance, so you focus on building. It's free to start with a verified domain and supports up to 3,000 contacts.

Why are my Resend emails going to spam?

Emails may hit spam due to missing SPF, DKIM, or DMARC records. Verify your domain fully in Resend and ensure all DNS records are correctly configured. Use a recognizable sender name and avoid trigger words. Resend includes unsubscribe links automatically for compliance. Monitor sender reputation and test emails to catch issues before sending to users.

Why are my emails going to spam?

Emails land in spam when SPF, DKIM, or DMARC records are missing or invalid, domain reputation is new, send volume ramps too quickly, email content has spam triggers, or recipient engagement is low. Check authentication records first. Warm up your domain gradually. Monitor bounce and complaint rates. Review email content for triggers. Contact Resend support if issues persist.