Skip to content

Quick Start

Get started quickly with JSX email

Prerequisites

New Project Setup

The fastest way to start is using our project creation tool:

Terminal window
npm create jsx-email

This creates an email-project directory with a starter template.

Installation

Install JSX email in your project:

Terminal window
pnpm add jsx-email

One-Time Execution

Run commands without installation:

Terminal window
pnpm dlx email <command>

Creating Templates

These steps will create a new template named BatmanEmail.tsx in the ./emails directory.

  1. Create templates directory:

    Terminal window
    mkdir ./emails
  2. Generate template:

    Terminal window
    email create BatmanEmail --out=./emails

Development

Preview Server

JSX-email includes a lightweight preview server with:

  • No additional dependencies
  • Simple setup
  • Monorepo support
  • Hot reloading

Launch the preview server:

Terminal window
email preview ./emails

Windows Users

Windows paths differ from Unix-like systems. Please see the link above regarding Windows relative paths if you are unfamiliar with how they work on the Command Line.

The CLI will startup a preview server and open a new browser tab at http://localhost:55420. It’s that simple.

Preview server options:

Terminal window
email help preview

Building Templates

Build templates using either:

  • CLI for static output
  • render method for dynamic runtime rendering

CLI Build

Terminal window
email build ./emails/BatmanEmail.tsx