email dev

Starts a local development server that will watch your files and automatically rebuild your email template when you make changes.

Options

--dir
string
default: "emails"

Change the directory of your email templates.

--port
string
default: "3000"

Port to run dev server on

F.A.Q

email build

Copies the preview app for onto .react-email and builds it.

--dir
string
default: "emails"

Change the directory of your email templates.

--packageManager
string
default: "npm"

Package manager to use on the installation of .react-email.

email start

Runs the built preview app that is inside .react-email.

email export

Generates the plain HTML files of your emails into a out directory.

A very common misconception is to assume that this command is the way meant to be used to send the email templates, but it is not.

The preferable way is to render the email using the render utility, by passing in the needed data through props, on the moment of sending the email, This gives for a much better developer experience that it would with email export.

email export is a secondary way where the situation is not optimal. Two of them are:

  • The email template is sent through some other language
  • You are going to use separate templating, because the email platform you use forces you to do so

We strongly recommend users to gravitate towards using the preferable way, because otherwise you will end up having to fight a lot with the rendered markup and many other issues arise.

Options

--outDir
string
default: "out"

Change the output directory.

--pretty
boolean
default: "false"

Minify or prettify the generated HTML file.

--plainText
boolean
default: "false"

Set output format as plain text.

--dir
string
default: "emails"

Change the directory of your email templates.

email help <cmd>

Shows all the options for a specific command.