Render
Transform React components into HTML email templates.
1. Install dependencies
Install package from your command line.
2. Create an email using React
Start by building your email template in a .jsx
or .tsx
file.
3. Convert to HTML
Import an existing React component and convert into a HTML string.
pretty
option to beautify the output.This will generate the following output:
4. Convert to Plain Text
Plain text versions of emails are important because they ensure that the message can be read by the recipient even if they are unable to view the HTML version of the email.
This is important because not all email clients and devices can display HTML email, and some recipients may have chosen to disable HTML email for security or accessibility reasons.
Here’s how to convert a React component into plain text.
This will generate the following output:
Options
Beautify HTML output
Generate plain text version
html-to-text
options used for rendering