|
| 1 | +# 📧 Email Templates Setup Guide |
| 2 | + |
| 3 | +This guide will help you implement the beautiful, aesthetic email templates for your Portfolio Tracker project in Supabase. |
| 4 | + |
| 5 | +## 🎨 Template Overview |
| 6 | + |
| 7 | +We've created three stunning email templates: |
| 8 | + |
| 9 | +1. **Confirm Signup** - Welcome new users with feature highlights |
| 10 | +2. **Reset Password** - Secure password reset with security tips |
| 11 | +3. **Magic Link** - Passwordless authentication with benefits showcase |
| 12 | + |
| 13 | +## 🚀 Implementation Steps |
| 14 | + |
| 15 | +### Step 1: Access Supabase Email Templates |
| 16 | + |
| 17 | +1. Go to your [Supabase Dashboard](https://supabase.com/dashboard) |
| 18 | +2. Select your Portfolio Tracker project |
| 19 | +3. Navigate to **Authentication** → **Email Templates** |
| 20 | + |
| 21 | +### Step 2: Configure Confirm Signup Template |
| 22 | + |
| 23 | +1. Click on **"Confirm signup"** template |
| 24 | +2. Replace the default content with the content from `email-templates/confirm-signup.html` |
| 25 | +3. **Important**: Replace `{{ .Email }}` with `{{ .Email }}` (Supabase uses this format) |
| 26 | +4. Replace `{{ .ConfirmationURL }}` with `{{ .ConfirmationURL }}` |
| 27 | +5. Click **Save** |
| 28 | + |
| 29 | +### Step 3: Configure Reset Password Template |
| 30 | + |
| 31 | +1. Click on **"Reset password"** template |
| 32 | +2. Replace the default content with the content from `email-templates/reset-password.html` |
| 33 | +3. Replace `{{ .Email }}` with `{{ .Email }}` |
| 34 | +4. Replace `{{ .ConfirmationURL }}` with `{{ .ConfirmationURL }}` |
| 35 | +5. Click **Save** |
| 36 | + |
| 37 | +### Step 4: Configure Magic Link Template |
| 38 | + |
| 39 | +1. Click on **"Magic link"** template |
| 40 | +2. Replace the default content with the content from `email-templates/magic-link.html` |
| 41 | +3. Replace `{{ .Email }}` with `{{ .Email }}` |
| 42 | +4. Replace `{{ .ConfirmationURL }}` with `{{ .ConfirmationURL }}` |
| 43 | +5. Click **Save** |
| 44 | + |
| 45 | +## 🎯 Template Features |
| 46 | + |
| 47 | +### ✨ Design Highlights |
| 48 | + |
| 49 | +- **Modern Gradient Headers**: Each template has a unique color scheme |
| 50 | +- **Responsive Design**: Works perfectly on mobile and desktop |
| 51 | +- **Brand Consistency**: Matches your Portfolio Tracker theme |
| 52 | +- **Professional Typography**: Clean, readable fonts |
| 53 | +- **Interactive Elements**: Hover effects and smooth transitions |
| 54 | + |
| 55 | +### 🔧 Customization Options |
| 56 | + |
| 57 | +#### Colors & Branding |
| 58 | +- **Confirm Signup**: Blue gradient (#3b82f6 to #1d4ed8) |
| 59 | +- **Reset Password**: Red gradient (#ef4444 to #dc2626) |
| 60 | +- **Magic Link**: Purple gradient (#8b5cf6 to #7c3aed) |
| 61 | + |
| 62 | +#### Content Sections |
| 63 | +- **Welcome Messages**: Personalized greetings |
| 64 | +- **Feature Highlights**: Showcase key benefits |
| 65 | +- **Security Information**: Important safety reminders |
| 66 | +- **Call-to-Action Buttons**: Clear, prominent CTAs |
| 67 | +- **Footer Links**: Support and social media |
| 68 | + |
| 69 | +## 📱 Mobile Optimization |
| 70 | + |
| 71 | +All templates are fully responsive and include: |
| 72 | +- Mobile-first design approach |
| 73 | +- Optimized typography for small screens |
| 74 | +- Touch-friendly button sizes |
| 75 | +- Proper spacing for mobile viewing |
| 76 | + |
| 77 | +## 🔒 Security Features |
| 78 | + |
| 79 | +### Built-in Security Elements |
| 80 | +- **Expiration Notices**: Clear time limits for links |
| 81 | +- **Security Warnings**: Alerts for unintended requests |
| 82 | +- **Privacy Information**: Data protection notices |
| 83 | +- **Support Contacts**: Easy access to help |
| 84 | + |
| 85 | +### Template Variables |
| 86 | +- `{{ .Email }}` - User's email address |
| 87 | +- `{{ .ConfirmationURL }}` - Secure confirmation link |
| 88 | +- `{{ .TokenHash }}` - Security token (if needed) |
| 89 | +- `{{ .SiteURL }}` - Your application URL |
| 90 | + |
| 91 | +## 🎨 Customization Guide |
| 92 | + |
| 93 | +### Changing Colors |
| 94 | +To modify the color scheme, update these CSS variables: |
| 95 | + |
| 96 | +```css |
| 97 | +/* Confirm Signup - Blue Theme */ |
| 98 | +background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); |
| 99 | + |
| 100 | +/* Reset Password - Red Theme */ |
| 101 | +background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); |
| 102 | + |
| 103 | +/* Magic Link - Purple Theme */ |
| 104 | +background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); |
| 105 | +``` |
| 106 | + |
| 107 | +### Updating Content |
| 108 | +- **Company Name**: Replace "Portfolio Tracker" with your brand |
| 109 | +- **Support Email **: Update `[email protected]` |
| 110 | +- **Social Links**: Add your actual social media URLs |
| 111 | +- **Features**: Customize the feature highlights for your app |
| 112 | + |
| 113 | +### Adding Your Logo |
| 114 | +Replace the SVG icon in the header with your actual logo: |
| 115 | + |
| 116 | +```html |
| 117 | +<div class="logo"> |
| 118 | + <!-- Replace with your logo --> |
| 119 | + <img src="your-logo-url.png" alt="Your Brand" style="width: 32px; height: 32px;"> |
| 120 | +</div> |
| 121 | +``` |
| 122 | + |
| 123 | +## 📊 Testing Your Templates |
| 124 | + |
| 125 | +### 1. Enable Email Confirmations |
| 126 | +1. Go to **Authentication** → **Settings** |
| 127 | +2. Enable **"Enable email confirmations"** |
| 128 | +3. Set **Site URL** to your domain |
| 129 | +4. Add redirect URLs for your app |
| 130 | + |
| 131 | +### 2. Test Each Template |
| 132 | +1. **Signup Test**: Create a new account |
| 133 | +2. **Password Reset Test**: Use "Forgot Password" feature |
| 134 | +3. **Magic Link Test**: Enable magic link authentication |
| 135 | + |
| 136 | +### 3. Preview Templates |
| 137 | +Use Supabase's built-in preview feature to see how templates look before sending. |
| 138 | + |
| 139 | +## 🚨 Troubleshooting |
| 140 | + |
| 141 | +### Common Issues |
| 142 | + |
| 143 | +#### Template Not Loading |
| 144 | +- Check for syntax errors in HTML |
| 145 | +- Ensure all CSS is properly formatted |
| 146 | +- Verify template variables are correct |
| 147 | + |
| 148 | +#### Styling Issues |
| 149 | +- Test in different email clients |
| 150 | +- Use inline CSS for better compatibility |
| 151 | +- Avoid complex CSS animations |
| 152 | + |
| 153 | +#### Links Not Working |
| 154 | +- Verify `{{ .ConfirmationURL }}` is properly set |
| 155 | +- Check redirect URLs in Supabase settings |
| 156 | +- Test link expiration times |
| 157 | + |
| 158 | +### Email Client Compatibility |
| 159 | +- **Gmail**: Full support |
| 160 | +- **Outlook**: Good support (some CSS limitations) |
| 161 | +- **Apple Mail**: Full support |
| 162 | +- **Mobile Apps**: Responsive design works well |
| 163 | + |
| 164 | +## 📈 Best Practices |
| 165 | + |
| 166 | +### Content Guidelines |
| 167 | +- Keep subject lines under 50 characters |
| 168 | +- Use clear, action-oriented language |
| 169 | +- Include your brand name in subject lines |
| 170 | +- Test with different email addresses |
| 171 | + |
| 172 | +### Design Guidelines |
| 173 | +- Use high contrast for readability |
| 174 | +- Keep images under 1MB |
| 175 | +- Use web-safe fonts as fallbacks |
| 176 | +- Test on multiple devices |
| 177 | + |
| 178 | +### Security Guidelines |
| 179 | +- Never include sensitive data in emails |
| 180 | +- Use HTTPS for all links |
| 181 | +- Implement proper link expiration |
| 182 | +- Monitor for suspicious activity |
| 183 | + |
| 184 | +## 🎉 Success Metrics |
| 185 | + |
| 186 | +Track these metrics to measure template effectiveness: |
| 187 | +- **Open Rates**: Aim for 20-30% |
| 188 | +- **Click-Through Rates**: Target 2-5% |
| 189 | +- **Conversion Rates**: Measure signup completions |
| 190 | +- **Bounce Rates**: Keep under 5% |
| 191 | + |
| 192 | +## 📞 Support |
| 193 | + |
| 194 | +If you need help with the templates: |
| 195 | +1. Check the Supabase documentation |
| 196 | +2. Review email client compatibility guides |
| 197 | +3. Test with different email providers |
| 198 | +4. Contact Supabase support if needed |
| 199 | + |
| 200 | +--- |
| 201 | + |
| 202 | +**🎨 Your Portfolio Tracker now has beautiful, professional email templates that will enhance user experience and build trust with your users!** |
0 commit comments