-
Notifications
You must be signed in to change notification settings - Fork 0
Email Templates
Customize Firebase Authentication email templates for a professional look.
Firebase sends automated emails for:
- ✉️ Email verification
- 🔐 Password reset
- 📧 Email address change
⚠️ SMS verification (Blaze plan only)
You can customize these templates in the Firebase Console.
- Go to Firebase Console
- Select your project
- Click Authentication in the left sidebar
- Click the Templates tab
- Select the email type you want to customize
Available email types:
- Email address verification
- Password reset
- Email address change revocation
- SMS verification (Blaze plan only)
You can customize:
- From name - Your app/company name
- Reply-to email - Where replies go
- Subject line - Email subject
- Email body - HTML template
Firebase provides a basic template. Here's how to make it professional:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Verify Your Email</title>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px;">
<div style="background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); padding: 30px; text-align: center; border-radius: 10px 10px 0 0;">
<h1 style="color: white; margin: 0;">Verify Your Email</h1>
</div>
<div style="background: #f7f7f7; padding: 30px; border-radius: 0 0 10px 10px;">
<p>Hello %DISPLAY_NAME%,</p>
<p>Thank you for creating an account with us! To complete your registration, please verify your email address by clicking the button below:</p>
<div style="text-align: center; margin: 30px 0;">
<a href="%LINK%" style="background: #667eea; color: white; padding: 15px 30px; text-decoration: none; border-radius: 5px; display: inline-block; font-weight: bold;">Verify Email Address</a>
</div>
<p>Or copy and paste this link into your browser:</p>
<p style="background: white; padding: 15px; border-radius: 5px; word-break: break-all;">%LINK%</p>
<p>This link will expire in 24 hours.</p>
<p>If you didn't create an account with us, please ignore this email.</p>
<hr style="border: none; border-top: 1px solid #ddd; margin: 30px 0;">
<p style="font-size: 12px; color: #666; text-align: center;">
This is an automated email. Please do not reply.<br>
© 2025 Your App Name. All rights reserved.
</p>
</div>
</body>
</html>-
%LINK%- Verification/reset link -
%EMAIL%- User's email address -
%DISPLAY_NAME%- User's display name (if set) -
%APP_NAME%- Your Firebase project name
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reset Your Password</title>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px;">
<div style="background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); padding: 30px; text-align: center; border-radius: 10px 10px 0 0;">
<h1 style="color: white; margin: 0;">🔐 Reset Your Password</h1>
</div>
<div style="background: #f7f7f7; padding: 30px; border-radius: 0 0 10px 10px;">
<p>Hello,</p>
<p>We received a request to reset the password for your account associated with <strong>%EMAIL%</strong>.</p>
<p>Click the button below to reset your password:</p>
<div style="text-align: center; margin: 30px 0;">
<a href="%LINK%" style="background: #f5576c; color: white; padding: 15px 30px; text-decoration: none; border-radius: 5px; display: inline-block; font-weight: bold;">Reset Password</a>
</div>
<p>Or copy and paste this link into your browser:</p>
<p style="background: white; padding: 15px; border-radius: 5px; word-break: break-all;">%LINK%</p>
<p><strong>Important:</strong> This link will expire in 1 hour.</p>
<div style="background: #fff3cd; border-left: 4px solid #ffc107; padding: 15px; margin: 20px 0; border-radius: 5px;">
<p style="margin: 0;"><strong>⚠️ Security Notice:</strong></p>
<p style="margin: 10px 0 0 0;">If you didn't request a password reset, please ignore this email and your password will remain unchanged.</p>
</div>
<hr style="border: none; border-top: 1px solid #ddd; margin: 30px 0;">
<p style="font-size: 12px; color: #666; text-align: center;">
This is an automated email. Please do not reply.<br>
© 2025 Your App Name. All rights reserved.
</p>
</div>
</body>
</html><!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Address Change</title>
</head>
<body style="font-family: Arial, sans-serif; line-height: 1.6; color: #333; max-width: 600px; margin: 0 auto; padding: 20px;">
<div style="background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); padding: 30px; text-align: center; border-radius: 10px 10px 0 0;">
<h1 style="color: white; margin: 0;">⚠️ Email Address Changed</h1>
</div>
<div style="background: #f7f7f7; padding: 30px; border-radius: 0 0 10px 10px;">
<p>Hello,</p>
<p>The email address for your account was recently changed to <strong>%NEW_EMAIL%</strong>.</p>
<p>If you made this change, you can safely ignore this email.</p>
<div style="background: #f8d7da; border-left: 4px solid #dc3545; padding: 15px; margin: 20px 0; border-radius: 5px;">
<p style="margin: 0;"><strong>⚠️ Didn't make this change?</strong></p>
<p style="margin: 10px 0 0 0;">If you didn't authorize this email change, click the button below immediately to revert it and secure your account.</p>
</div>
<div style="text-align: center; margin: 30px 0;">
<a href="%LINK%" style="background: #dc3545; color: white; padding: 15px 30px; text-decoration: none; border-radius: 5px; display: inline-block; font-weight: bold;">Revert Email Change</a>
</div>
<p>Or copy and paste this link into your browser:</p>
<p style="background: white; padding: 15px; border-radius: 5px; word-break: break-all;">%LINK%</p>
<p>This link will expire in 48 hours.</p>
<hr style="border: none; border-top: 1px solid #ddd; margin: 30px 0;">
<p style="font-size: 12px; color: #666; text-align: center;">
This is an automated email. Please do not reply.<br>
© 2025 Your App Name. All rights reserved.
</p>
</div>
</body>
</html>In Firebase Console → Authentication → Templates:
-
From name: Your app/company name
- Example: "MyApp Team"
- Example: "Your Company Name"
-
Reply-to email: Your support email
- Example: "support@yourapp.com"
- Example: "noreply@yourapp.com"
For better deliverability, authenticate your domain:
- Go to Firebase Console → Project Settings
- Under "Public-facing name", add your domain
- Configure SPF and DKIM records in your DNS
For complete control, create custom email action handlers.
Create public/auth-action.html:
<!DOCTYPE html>
<html>
<head>
<title>Email Action Handler</title>
<script type="module">
import { initializeApp } from 'https://www.gstatic.com/firebasejs/10.0.0/firebase-app.js'
import { getAuth, applyActionCode, verifyPasswordResetCode, confirmPasswordReset } from 'https://www.gstatic.com/firebasejs/10.0.0/firebase-auth.js'
const firebaseConfig = {
// Your config
}
const app = initializeApp(firebaseConfig)
const auth = getAuth(app)
const params = new URLSearchParams(window.location.search)
const mode = params.get('mode')
const code = params.get('oobCode')
switch (mode) {
case 'verifyEmail':
await applyActionCode(auth, code)
// Show success message
break
case 'resetPassword':
// Show password reset form
break
}
</script>
</head>
<body>
<div id="message"></div>
</body>
</html>- Firebase Console → Authentication → Templates
- Click "Customize action URL"
- Enter:
https://your-domain.com/auth-action
Using a custom domain (vs @firebaseapp.com) improves deliverability.
Set up SPF, DKIM, and DMARC records.
Keep bounce rates low by:
- Validating email addresses before signup
- Removing invalid emails
- Using double opt-in
- Don't use all caps in subject lines
- Avoid excessive punctuation
- Include an unsubscribe option for marketing emails
- Use proper HTML formatting
import { sendEmailVerification } from 'firebase/auth'
const sendTestVerification = async () => {
const user = auth.currentUser
if (user) {
await sendEmailVerification(user)
console.log('Verification email sent!')
}
}Always check spam/junk folders when testing.
Test templates in:
- Gmail
- Outlook
- Apple Mail
- Yahoo Mail
- Check spam folder
- Verify email address is correct
- Check Firebase usage limits (100 emails/day on free tier)
- Verify domain authentication
- Authenticate your domain
- Avoid spam trigger words
- Include physical address in footer
- Use professional email design
- Clear browser cache
- Wait 5-10 minutes for changes to propagate
- Send a test email to verify
- Use clean, minimal design
- Limit colors to 2-3
- Use plenty of white space
- Use responsive design
- Test on mobile devices
- Use readable font sizes (14px minimum)
- Make buttons stand out
- Use action-oriented text
- Place CTA prominently
- Add logo
- Use brand colors
- Include company name
Next: API Reference →
Firebase React Template | Made with ❤️ | GitHub | Report Issues
Getting Started
Configuration
Advanced Topics
Deployment
- React 19
- Vite
- Firebase 12
- Redux Toolkit
- React Router