Template Libraries
Choose the right template library for your email needs with Keplars Mail Service
Keplars Mail Service works with popular email template libraries. Choose the one that fits your workflow and build beautiful, responsive emails.
Available Template Libraries
React Email
Build type-safe, component-based email templates using React. Perfect for teams already using React or TypeScript.
Best for: Modern JavaScript projects, TypeScript codebases, component reusability
Key features:
- Component-based architecture with React
- Full TypeScript support and type safety
- Live preview server for development
- Pre-built components for common email patterns
Learn more about React Email →
MJML
A markup language designed specifically for responsive emails. MJML uses semantic tags that compile to responsive HTML.
Best for: Responsive email design, email-first projects, teams focused on email deliverability
Key features:
- Semantic syntax that's easy to learn
- Automatically responsive across all email clients
- Rich component library for common layouts
- No need to worry about email client compatibility
Handlebars
A simple templating language that lets you build dynamic emails with variables and logic. Works seamlessly with Nodemailer.
Best for: Server-side rendering, simple dynamic content, existing Handlebars users
Key features:
- Simple mustache-style syntax
- Logic-less templates for clean separation
- Easy variable interpolation
- Built-in helpers and partials support
Pug / EJS
Traditional Node.js template engines that work great for email templates. Use Pug for clean indentation-based syntax or EJS for embedded JavaScript.
Best for: Existing Node.js projects, developers familiar with traditional templating
Key features:
- Pug: Clean, indentation-based syntax
- EJS: Embedded JavaScript in templates
- Full JavaScript expressions support
- Works with the email-templates package
Choosing a Template Library
All template libraries work with Keplars Mail Service. They compile to HTML which you send through the API:
// All libraries follow this pattern:
const html = await renderTemplate(templateData);
await fetch('https://api.keplars.com/api/v1/send-email/async', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
to: ['[email protected]'],
subject: 'Your Subject',
body: html // Rendered HTML from any template library
})
});You can use multiple template libraries in the same project. Each library compiles to HTML that works with Keplars Mail Service.
Next Steps
- Send Emails - Learn how to send emails with Keplars
- Email Templates - Use dashboard templates with the Template Engine
- API Reference - Complete API documentation