Before you start
- Add your domain in Mektup and the DNS records it shows.
- Create an API key (Dashboard, API keys) and add it to your project's secrets as
MEKTUP_API_KEY. - For a contact form, create a form under Forms and copy its access key.
The prompt
Add email to this app with Mektup (https://usemektup.com).
1. Create a Supabase edge function "send-email" that receives { to, subject, text }
and POSTs it to https://api.usemektup.com/v1/emails with the header
"Authorization: Bearer " + MEKTUP_API_KEY and the body
{ from: "hello@<our domain>", to, subject, text }.
Read MEKTUP_API_KEY from the function's secrets. Never put it in frontend code.
2. Use that function for welcome emails and order confirmations.
3. Make the contact form POST to https://api.usemektup.com/submit with a hidden
field access_key = "<our Mektup form key>" and fields name, email, message.
Show a success message when the JSON response has success: true.Sign-up and password emails
Auth emails come from Supabase itself. Point Supabase at Mektup as custom SMTP so they leave from your domain without the 2-an-hour limit: the settings.