4.7 KiB
🚀 Quick Deploy Checklist
Current Status
- ✅ Auth page registration works in production
- ✅ Email is being sent
- ❌ Email missing master template wrapper (needs deployment)
What You Need to Do
Step 1: Deploy Updated Edge Function (CRITICAL)
The email is sending but without the master template. You need to deploy the updated send-auth-otp function.
Option A: If you have Supabase CLI access
ssh root@lovable.backoffice.biz.id
cd /path/to/supabase
supabase functions deploy send-auth-otp
Option B: Manual deployment
ssh root@lovable.backoffice.biz.id
# Find the edge functions directory
cd /path/to/supabase/functions
# Backup current version
cp send-auth-otp/index.ts send-auth-otp/index.ts.backup
# Copy new version from your local machine
# (On your local machine)
scp supabase/functions/send-auth-otp/index.ts root@lovable.backoffice.biz.id:/path/to/supabase/functions/send-auth-otp/
# Restart edge function container
docker restart $(docker ps -q --filter 'name=supabase_edge_runtime')
Option C: Git pull + restart
ssh root@lovable.backoffice.biz.id
cd /path/to/project
git pull origin main
cp supabase/functions/send-auth-otp/index.ts /path/to/supabase/functions/send-auth-otp/
docker restart $(docker ps -q --filter 'name=supabase_edge_runtime')
Step 2: Verify Deployment
After deployment, test the registration:
- Go to https://with.dwindi.com/auth
- Register with a NEW email address
- Check your email inbox
Expected Result:
- ✅ Email has black header with "ACCESS HUB" logo
- ✅ Email has proper brutalist styling
- ✅ OTP code is large and centered
- ✅ Email has footer with unsubscribe links
Step 3: Confirm Checkout Flow
The checkout page already redirects to auth page for registration, so no changes needed.
Verify:
- Add product to cart
- Go to checkout
- If not logged in, redirects to
/auth - Register new account
- Receive OTP email with proper styling ✅
- Verify email
- Login
- Complete checkout
What Was Fixed
Before
<!-- Email was just the content without wrapper -->
<h1>🔐 Verifikasi Email</h1>
<p>Halo {nama},</p>
<div class="otp-box">{otp_code}</div>
After (With Master Template)
<!DOCTYPE html>
<html>
<head>...</head>
<body>
<table>
<!-- Header with ACCESS HUB branding -->
<tr>
<td style="background: #000; padding: 25px 40px;">
ACCESS HUB | NOTIF #123456
</td>
</tr>
<!-- Main content with OTP -->
<tr>
<td>
<div class="email-content">
<h1>🔐 Verifikasi Email</h1>
<p>Halo {nama},</p>
<div class="otp-box">{otp_code}</div>
</div>
</td>
</tr>
<!-- Footer -->
<tr>
<td>
ACCESS HUB
Email ini dikirim otomatis
Unsubscribe
</td>
</tr>
</table>
</body>
</html>
Files Changed
Only ONE file needs to be deployed:
supabase/functions/send-auth-otp/index.ts
Changes:
- Added
EmailTemplateRendererclass (260 lines) - Updated email body processing to use master template
- No database changes needed
- No frontend changes needed
Testing After Deployment
# 1. Register new user
# Go to /auth and fill registration form
# 2. Check OTP was created
# In Supabase SQL Editor:
SELECT * FROM auth_otps ORDER BY created_at DESC LIMIT 1;
# 3. Check email received
# Should have:
# - Black header with "ACCESS HUB"
# - Notification ID (NOTIF #XXXXXX)
# - Large OTP code in dashed box
# - Gray footer with unsubscribe links
# 4. Verify OTP works
# Enter code from email
# Should see: "Verifikasi Berhasil"
Success Criteria
✅ Email has professional brutalist design ✅ ACCESS HUB branding in header ✅ Notification ID visible ✅ OTP code prominently displayed ✅ Footer with unsubscribe links ✅ Responsive on mobile ✅ Works in all email clients
Rollback Plan (If Something Breaks)
# If deployment fails, restore backup
ssh root@lovable.backoffice.biz.id
cd /path/to/supabase/functions/send-auth-otp
cp index.ts.backup index.ts
docker restart $(docker ps -q --filter 'name=supabase_edge_runtime')
Need Help?
Check logs:
docker logs $(docker ps -q --filter 'name=supabase_edge_runtime') | tail -100
Test edge function directly:
curl -X POST https://lovable.backoffice.biz.id/functions/v1/send-auth-otp \
-H "Authorization: Bearer YOUR_SERVICE_KEY" \
-H "Content-Type: application/json" \
-d '{"user_id":"TEST_ID","email":"test@example.com"}'
Summary
Status: Ready to deploy Files to deploy: 1 (send-auth-otp edge function) Risk: Low (email improvement only) Time to deploy: ~5 minutes
After deployment, test registration with a new email to confirm the email has proper styling!