The send-invite-email Edge Function automatically sends email invitations when a household invite is created in the app.
Supabase CLI installed:
On macOS (Homebrew):
brew install supabase/tap/supabase
On Linux:
# Download binary
curl -fsSL https://github.com/supabase/cli/releases/latest/download/supabase_linux_amd64.tar.gz | tar -xz
sudo mv supabase /usr/local/bin/
On Windows:
scoop bucket add supabase https://github.com/supabase/scoop-bucket.git
scoop install supabase
Or download from: https://github.com/supabase/cli/releases
Supabase project linked:
supabase link --project-ref your-project-ref
Or get your project ref from Supabase Dashboard → Settings → General → Reference ID
supabase secrets set RESEND_API_KEY=re_xxxxxxxxxxxxx
supabase/functions/send-invite-email/index.ts'MyKid <invites@mykid.app>' to your verified domain'onboarding@resend.dev' (for testing)supabase functions deploy send-invite-email
If you have SMTP configured in Supabase Dashboard → Settings → Auth → SMTP Settings:
If you don’t configure email, the function will return a message indicating email is not configured, but the invite will still be created and can be shared manually via link/code.
After deployment, test the function:
supabase functions invoke send-invite-email \
--body '{"email":"test@example.com","inviteToken":"test-token","inviteCode":"TESTCODE"}'
Or test from the app: create an invite and check if email is sent.
RESEND_API_KEY - Required if using ResendAPP_URL - Optional, for web invite links (defaults to https://mykid.app)SUPABASE_URL - Automatically set by SupabaseSUPABASE_ANON_KEY - Automatically set by SupabaseThe function sends an HTML email with:
mykid://invite/<token>)supabase functions list)