Preguntas frecuentes
What is React Email and should I use it?
React Email is an open-source library that lets you build email templates using React components, which get compiled to email-compatible HTML. It solves many of the developer experience frustrations around email HTML by letting you use modern component patterns, TypeScript, and your normal React tooling. Platforms like Resend have first-class React Email support. If your team is already building a React application, React Email is a natural fit. For non-React teams, tools like MJML offer similar benefits without the React dependency.
What is MJML and why do developers use it for emails?
MJML is an open-source framework that lets you write email templates in a responsive, component-based syntax that compiles down to email-safe HTML with all the table-based layout code handled for you. Writing email HTML by hand to be compatible across Outlook, Gmail, and Apple Mail is genuinely painful because the email client compatibility constraints are severe. MJML abstracts away the compatibility work and lets you focus on the layout and content. Most email platforms accept the compiled HTML output from MJML.
Can I version control my email templates in Git?
Yes, and you should. If you manage templates via the API or export them as HTML files, you can store them in a Git repository alongside your application code. This gives you full version history, the ability to review template changes through pull requests, and the ability to roll back if a template update breaks something. Platforms with robust template APIs make this workflow easier. Postmark and SendGrid both have template APIs that work well with Git-based deployment workflows.
What templating language is best for email marketing?
Handlebars is probably the most widely supported across email platforms, used by SendGrid, Mailgun, and others. It is simple, well-documented, and sufficient for most email use cases. Liquid (used by Customer.io and Klaviyo) is more powerful with better loop and filter support, making it easier to build complex personalized templates. For teams building custom systems, Jinja2 or Mustache are also popular choices. The best templating language is the one your team already knows and that your email platform natively supports.
How do I handle dynamic content in code-based email templates?
Dynamic content is handled through your templating language's variable and conditional syntax. For example, in Handlebars you use double curly braces to insert variables and hash notation for conditionals. You pass the dynamic data as a JSON payload when calling the send or render API endpoint. This means your template defines the structure and variables, and your application provides the actual values at send time. For complex dynamic content like product recommendation grids, you typically pre-compute the data in your application before passing it to the template.
What are the most common cross-client rendering issues with custom HTML templates?
Outlook is responsible for the majority of email rendering headaches. It uses Microsoft Word's rendering engine for HTML and CSS, which means Flexbox, CSS Grid, and many modern CSS properties do not work. Table-based layouts are still the most reliable for complex multi-column designs in Outlook. Gmail strips certain CSS at the head level, requiring inline styles for Gmail compatibility. Background images also behave differently across clients. Tools like Can I Email document cross-client CSS support, similar to Can I Use for web browsers.