Overview
Lovable is an AI-powered platform that lets you build full-stack web apps from natural language prompts. You can integrate AutoSend into any Lovable project to send transactional emails like welcome emails, password resets, order confirmations, and notifications.
Prerequisites
AutoSend Account
Sign up for an AutoSend account to get started with sending emails.
Verified Domain
Make sure you have a verified domain added in AutoSend to send emails from.
API Key
Create a new API key from your AutoSend dashboard for authentication.
Lovable with Supabase
Connect Supabase to your Lovable project to use Edge Functions.
Integration
Connect Supabase to your Lovable project
Lovable uses Supabase Edge Functions to securely handle API keys. If you haven’t connected Supabase yet, click the Supabase icon in your Lovable project and follow the authorization steps.
Add your AutoSend API key as a secret
- In your Lovable project, go to Supabase > Secrets
- Add a new secret with the name
AUTOSEND_API_KEY - Paste your AutoSend API key as the value
Get your API key from the API Keys page in your AutoSend dashboard.
Prompt Lovable to integrate AutoSend
Copy and paste this prompt into Lovable’s chat:
Lovable will generate a Supabase Edge Function and wire it into your app automatically.
Test your integration
Once Lovable finishes generating the code, trigger the email flow in your app (for example, submitting a contact form). Check your Email Activity in the AutoSend dashboard to confirm the email was delivered.
Using Email Templates
If you have created email templates in AutoSend, you can send emails using atemplateId instead of inline HTML. Update the prompt to include:
Example Use Cases
Here are some common ways to use AutoSend in your Lovable apps:- Contact forms that send a confirmation email to the user and a notification to your team
- User signup flows with welcome emails or email verification
- Order confirmations and shipping notifications for e-commerce apps
- Password reset emails triggered from your auth flow
- Newsletter signups that send a double opt-in confirmation
Troubleshooting
Emails are not being sent
Emails are not being sent
Make sure your
AUTOSEND_API_KEY is correctly added in Supabase Secrets. Also verify that your sending domain is verified in AutoSend by checking Settings > Domains in your dashboard.Getting a 401 Unauthorized error
Getting a 401 Unauthorized error
Emails landing in spam
Emails landing in spam
Make sure you have completed domain verification including SPF, DKIM, and DMARC records. We recommend using a subdomain like
mail.yourdomain.com for sending. See our domain setup guide for details.Lovable shows build errors
Lovable shows build errors
Lovable may sometimes show false positive build errors. Always test your app live by triggering the actual email flow. If the Edge Function deploys successfully in Supabase, the integration is likely working.