Creating Custom HTML Templates
For developers and designers who want complete control, MailGreet’s HTML Editor provides full HTML/CSS capabilities with syntax highlighting, live preview, and variable support.When to Use HTML Editor
Use HTML Editor For
- Complex custom designs
- Importing external templates
- Pixel-perfect layouts
- Advanced CSS styling
- Developer-controlled emails
Use Block Builder For
- Quick email creation
- Non-technical users
- Standard layouts
- Easy editing by team
- Mobile-responsive defaults
Creating an HTML Template
Go to Templates
Navigate to Templates in the sidebar
Select HTML Editor
Choose HTML Editor from the three format options:
- Block-Based Editor (Recommended)
- HTML Editor ← Select this
- Plain Text
Enter Template Details
Fill in the template information:
- Template Name — A descriptive name
- Description — Purpose of the template
- Category — Newsletters, Marketing, Events, Transactional, or Custom
HTML Editor Interface
The HTML Editor provides a split-screen workspace:| Panel | Location | Purpose |
|---|---|---|
| Code Editor | Left | Write and edit HTML code |
| Live Preview | Right | See real-time rendering |
| Top Bar | Top | Subject, preheader, and actions |
Top Bar Fields
Subject Line
The email subject line that appears in inboxes
Preheader
Preview text shown after the subject line
Editor Features
- Syntax Highlighting — Color-coded HTML/CSS for readability
- Line Numbers — Easy navigation for debugging
- Auto-Indent — Clean, organized code
- Live Preview — Instant visual feedback as you code
Writing Email HTML
Basic Template Structure
Start with this responsive email boilerplate:Using Variables
Insert personalization variables anywhere in your HTML:| Variable | Description |
|---|---|
{{first_name}} | Subscriber’s first name |
{{last_name}} | Subscriber’s last name |
{{email}} | Subscriber’s email address |
{{unsubscribe_link}} | Required unsubscribe URL |
{{custom_field}} | Any custom field you’ve created |
Importing External HTML
Have an HTML template from another source? Import it easily:Exporting Templates
Export as HTML
Click Export HTML to download the raw HTML file for use elsewhere.Export as Template JSON
Export the complete template configuration for:- Backup purposes
- Sharing with team members
- Moving between MailGreet accounts
HTML Email Best Practices
Use Tables for Layout
Use Tables for Layout
Email clients have inconsistent CSS support. Use
<table> elements for reliable layouts, not <div> or flexbox.Inline Your CSS
Inline Your CSS
Many email clients strip
<head> styles. Use inline CSS on elements:Set Width 600px Max
Set Width 600px Max
Most email clients display best at 600px width. Use
max-width: 600px for your container.Always Include Alt Text
Always Include Alt Text
Images are often blocked by default. Add descriptive
alt attributes:Avoid JavaScript
Avoid JavaScript
JavaScript is stripped by all email clients. Never rely on JS for functionality.
Use Web-Safe Fonts
Use Web-Safe Fonts
Stick to web-safe fonts (Arial, Georgia, Times New Roman) or use font stacks with fallbacks.
Testing Your Template
Before using in campaigns:Common Issues & Solutions
| Issue | Solution |
|---|---|
| Layout breaks in Outlook | Use table-based layout with mso- conditional comments |
| Images not showing | Use absolute URLs, not relative paths |
| Fonts look different | Use web-safe fonts with proper fallbacks |
| Background images not working | Many clients don’t support CSS background images |
| Styles being stripped | Inline all CSS, don’t use external stylesheets |

