Ship them
Lovable apps
Connect TemplatePort to Lovable and ask for your emails in chat, or paste a prompt. Includes emails in edge functions.
On this page
Before you start
In Lovable, set up your email domain under Cloud → Emails so your app can send from your own address. The export works for both kinds of email a Lovable app sends:
- Lovable's built-in emails: the auth emails (sign-up, reset password…) and app emails Lovable manages for you.
- Emails in your own edge function: emails your project builds itself in a Supabase edge function, for example with Resend.
Connect TemplatePort to Lovable
The easiest way to get emails into a Lovable project: connect once, then ask in chat. Lovable's agent fetches your emails from TemplatePort itself, always in their latest version. TemplatePort works as an MCP server: a connector Lovable (and Replit, Bolt, v0, Cursor or Claude Code) can talk to.
- 1In TemplatePort, open Providers and scroll to Use TemplatePort from your AI builder. Copy the server URL and choose Create key (name it Lovable). The key is shown once.
- 2In Lovable, open Connectors, select + and choose MCP server. Name it TemplatePort and paste the server URL.
- 3Choose Bearer token as the authentication and paste the key.
- 4In your project chat, ask for what you need, such as
Use TemplatePort to update my auth emailsorWhich TemplatePort emails changed since I last updated them?The editor's Export → AI builders tab gives you the exact message for one email.
The agent can list your templates, read your brand kit, browse the gallery and get any email as code with the same rules as the export prompt. Every email it fetches counts as an export, so Re-export and the out-of-sync labels keep working.
When you ask for an email you don't have yet, the agent adds it to TemplatePort first: a gallery design, or a new email written by TemplatePort's AI from your description. Either way it's saved on your Templates page, marked From Lovable, in your brand and your brand kit's email language, so you can edit it in TemplatePort and ask Lovable to update it. Gallery designs are translated when your email language isn't English; new and translated emails count toward your AI generations.
On the Free plan the agent can browse and add emails to your templates. Fetching emails as code comes with the Launch Pack and Pro. Each key allows 60 calls an hour; revoke a key on the Providers page and it stops working right away.
Exporting several emails at once
- 1On the Templates page, choose Send to AI builder.
- 2Tick the emails, or Select all.
- 3For each one, pick where it goes: an app email, one of the auth emails, or an email in an edge function.
- 4If TemplatePort is connected to Lovable, copy the chat message at the top. Otherwise open Or copy prompts for Lovable, copy the prompt and paste it into your Lovable project's chat. Long exports are split into parts: paste them one after the other.
The prompt tells Lovable to keep your sign-in links and variables working, use a white background, and leave other emails alone. For one email, the editor's Export → AI builders tab does the same.
Emails in an edge function
Choose Email in an edge function and enter the function's name (its folder in supabase/functions, such as send-notification-email) and the email's name inside it (such as booking_confirmation).
- If the email was pushed to Resend, Lovable changes the function to send that Resend template. From then on, design changes are just a push from TemplatePort: no code change, no Lovable credits.
- Otherwise the prompt includes a small file with the subject and HTML, and Lovable uses it for that email.
Lovable only changes the email you named. Checks on who can send, the data, the recipients and the sender address stay as they are.
Updating later
Exported emails show a Lovable label on the Templates page. When you change one, or your brand kit, it shows as out of sync and Send again opens the export with those emails ticked.
Each exported file starts with a "Made with TemplatePort" comment, so you (and Lovable) know where to change it.
Related guides
Something unclear or missing? Email hello@templateport.app.