Skip to content

Commit 448cd09

Browse files
authored
feat(docs): Improved email export callout (#1677)
1 parent 230f474 commit 448cd09

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

apps/docs/cli.mdx

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -157,21 +157,23 @@ Runs the built preview app that is inside `.react-email`.
157157
Generates the plain HTML files of your emails into a `out` directory.
158158

159159
<Info>
160-
A very common misconception is to assume that this command is
161-
the way meant to be used to send the email templates, but it is not.
160+
A very common misconception is to assume that `email export` is the default or primary way of rendering
161+
email templates.
162162

163-
The preferable way is to render the email using the [render](/utilities/render) utility,
164-
by passing in the needed data through props, on the moment of sending the email,
165-
This gives for a much better developer experience that it would with `email export`.
163+
The primary and preferable way is always going to be the [render](/utilities/render) utility,
164+
by passing in the needed data through props, on the exact moment of sending the email.
166165

167-
`email export` is a secondary way where the situation is not optimal. Two of them are:
166+
`email export` is a secondary way meant for situations where React Email cannot be used optimally.
167+
With this secondary way, comes significant drawbacks, mainly the need for manual templating, which
168+
could be done easily with the `render` utility. It being a secondary way, we would strongly recommend
169+
you don't use it unless you really are forced into it.
168170

169-
- The email template is sent through some other language
170-
- You are going to use separate templating, because the email platform you use forces you to do so
171-
172-
We strongly recommend users to gravitate towards using the preferable way, because otherwise
173-
you will end up having to fight a lot with the rendered markup and many other issues arise.
171+
As an example, two cases where `email export` makes itself necessary include:
172+
- When the email content must be processed by a backend in a language other than JavaScript.
173+
- When the platform handling email, such as Shopify, forces you into manual templating.
174174

175+
You also should not have to worry about `render`'s performance, as typically, the introduced
176+
time in rendering is going to be milliseconds when compared to manual templating.
175177
</Info>
176178

177179
**Options**

0 commit comments

Comments
 (0)