Skip to content

Raw

Use raw HTML and unescaped text effortlessly

Install

Install the component from your command line

Terminal window
pnpm add jsx-email

Usage

This component is especially useful for placing additional templating languages in your rendered email templates, for use in email providers which have their own value injection, or for further processing later in a separate system.

Add the component to your email template. Include styles where needed.

import { Raw } from 'jsx-email';
const hero = true;
const HeroOrVillain = () => {
return (
<>
<Raw content={`<#if ${hero}>`} />
<b>Batman's a hero</b>
<Raw content={`</#if>`} />
</>
);
};

Which if used in a template, would yield the following when rendered:

<#if true>
<b>Batman's a hero</b>
</#if>

Props

Optional Props

content

content?: string;

The raw text content to render into a template

disablePlainTextOutput

disablePlainTextOutput?: boolean;

If true, the content of the Raw component will not be rendered during plain text rendering