Full JSX email documentation as Markdown. # Introduction > Build and send emails using React and TypeScript. JSX email provides a set of React components and helpers for building delightful and responsive email templates, compatible with modern email clients. Our components handle the heavy lifting of compatibility and client inconsistency so designers and developers can focus on building impactful and engaging templates. ## Getting Started Everything to know about the components, props, and usage is available within our [Documentation Site](https://jsx.email/docs/introduction). Please give that a read and let us know if there’s anything we can help with. ## Components A list of available components can be found on the [`jsx-email` Documentation](https://jsx.email/docs/introduction) ## Featured Features The goals of this project are to provide an improved focus on Developer Experience, maintenance, fast improvements and fast releases. And there are number of key features that make JSX email what it is: * [Email Client Compatibility Checking](https://jsx.email/docs/core/cli#client-compatibility-check) * Exclusive Components * Handles cross-client inconsistencies for you * Optional Configuration Files * Plugins * Crazy fast Tailwind support * Support for `` and `async` within Components * Enhanced Developer Experience (DX) * Wonderful Command Line tools * Works with Monorepos out of the box. No exhaustive setup needed. * A smooth and simple Preview Server * Fast improvements, feature development, and releases * Community-driven, not Company-driven * No vendor lock-in for tools. `jsx-email` uses only generic components and tools ## Service Integrations This includes [AWS SES](https://aws.amazon.com/ses), [Loops](https://loops.so), [Nodemailer](https://nodemailer.com), [Postmark](https://postmarkapp.com),[Resend](https://resend.com), [Plunk](https://www.useplunk.com/), and [SendGrid](https://sendgrid.com). See our documentation on [Email Providers](https://jsx.email/docs/email-providers) for more info and example usage. ## Migrating to Version 3 See the [v3 migration guide](/docs/v3/migration) for a full list of breaking changes and important information about updating to v3.0.0. To browse the source code and documentation markdown for v2.8.4 please [click here](https://github.com/shellscape/jsx-email/tree/jsx-email-v2.8.4). ## Contributing, Working With This Repo [![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com) We 💛 contributions! After all, this is a community-driven project. We have no corporate sponsorship or backing. The maintainers and users keep this project going! Please check out our [Contribution Guide](./CONTRIBUTING.md). JSX email is [MIT Licensed](./LICENSE.md) We (the maintainers) use JSX email daily. --- # Quick Start > Quick Start ## Quick Start In this doc you’ll find information on quickly getting started using JSX email. For more in-depth information, please see the other sections of our Documentation. Info This guide, along with the rest of the documentation here, assume that the reader has fundamental Node and NPM skills and is familiar with using command line tools on Window, Linux, or Mac OS. For those not familiar with the bits above, here are some links to resources that we’d recommend reading before working with this project: * [Node Fundamentals](https://www.codecademy.com/learn/learn-nodejs-fundamentals/modules/intro-to-node-js/cheatsheet) * [NPM Fundamentals](https://nodesource.com/blog/an-absolute-beginners-guide-to-using-npm/) * [Executing Local NPM Packages](https://jaireina.medium.com/executing-local-npm-packages-226820ad2c31) * [`npx`](https://docs.npmjs.com/cli/v8/commands/npx) and [`pnpm exec`](https://pnpm.io/cli/exec) * [How to use relative paths on windows CMD?](https://superuser.com/a/1270599) ## Prerequisites * [Node.js](https://nodejs.org/en/) [LTS Version](https://github.com/nodejs/Release) v22.0.0+ * React v19.1.0+ ## New Projects If you’re starting a new project — whether that’s a project solely for email templates, or a project that will eventually host additional code — our [`create-mail`](https://github.com/shellscape/jsx-email/tree/main/packages/create-mail) utility is a perfect choice, and the fastest way to get started. The utility will scaffold a new project and get everything ready for developing new email templates. To begin, make sure you have a terminal (or command line) open and your current working directory is the directory you’d like to create a new project. Run the following command in your terminal (without the `$` symbol): ``` $ npx create-mail my-email-project ``` This command will install and execute `create-mail`, create a `my-email-project` directory, and add a starter template. While the *Existing Projects* section below can be safely skipped, the information beneath it is useful and worth giving a read before working with JSX email, as it contains information on the project and template that was just created. ## Existing Projects The happy path for adding JSX email to an existing project is by using the JSX email CLI: pnpm aube bun npm yarn ``` pnpm add jsx-email ``` ``` aube add jsx-email ``` ``` bun add jsx-email ``` ``` npm add jsx-email ``` ``` yarn add jsx-email ``` If you want to avoid global installation, you can use `pnpm dlx`, `npx`, or `yarn` instead like so: ``` $ pnpm dlx email ``` ## Create A Template First, we’ll create a directory for our email templates, and then add a new template: ``` $ mkdir ./emails $ email create BatmanEmail --out=./emails ``` This command will create a new template named `BatmanEmail.tsx` in the `./emails` directory. Tips If you’d rather create a `.jsx` file, use the `--jsx` flag ## Email Previews One of the major benefits of JSX email over alternatives is our incredibly slim and fast preview server, which requires no additional dependency installation, complex mounting, or difficult setup rules for monorepos. To run the preview server, run the following command in your terminal: ``` # MacOS and Linux $ email preview ./emails ``` Info Windows paths are different than MacOS or Linux paths. `./emails` above will not work on Windows. 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. Tips Please use `email help preview` to view optional flags, including setting the port. ## Building Your Template The next step is to build your template. This can be done with the CLI, or with the [`render` method](/docs/core/render) in code. While most people will need to render emails dynamically at runtime using `render`, the CLI is capable of rendering both static and dynamic emails that take props as input. To build your email into an HTML document, run: ``` $ email build ./emails/BatmanEmail.tsx ``` Tips Please use `email help build` to view optional flags, including providing props and setting the output path. --- # CLI > The Command Line Interface and developer tooling for JSX email The Command Line Interface and developer tooling for JSX email pnpm aube bun npm yarn ``` pnpm add jsx-email ``` ``` aube add jsx-email ``` ``` bun add jsx-email ``` ``` npm add jsx-email ``` ``` yarn add jsx-email ``` Nearly all installations of this package will want it installed into `devDependencies` so please make sure to add the `-D` flag. ## Usage Installing this package will add an `email` binary, which will be available to `pnpm exec`, `npx`, and `yarn`. Invoking the CLI without parameters or flags will produce help information in the console. From there, all of the functions of the CLI can be viewed, along with any applicable parameters and flags: ``` → pnpm exec email jsx-email v0.0.0 A CLI for working with Email Templates made with jsx-email Usage $ email [...options] Commands build