A React Email template for a weekly metrics email: two KPI tiles, an MRR trend and signups by day. The charts are PNG images drawn by Chartshot, which email clients show like any other image.
| Light | Dark |
|---|---|
![]() |
![]() |
Needs Node 22 or later.
npm install
npm run devOpen http://localhost:3000 to preview. The sample data is in sample in emails/weekly-digest.tsx.
Each chart is a JSON spec turned into an image URL. emails/chart.tsx picks the URL:
- No account: a keyless URL. It works straight away, carries a small Chartshot badge, and is limited to 60 charts a minute per IP address. Each email has four charts, so use it to try the template, not for bulk sends.
- With a key: copy
.env.exampleto.envand setCHARTSHOT_SECRET_KEYandCHARTSHOT_PUBLIC_ID. The SDK'sChartImagethen signs each URL, with no badge. Signed URLs need Chartshot Pro and up; with a Free or wrong key, each chart shows an error image that says why.
The URL holds the data and doesn't expire, so the email keeps showing the numbers it was sent with.
With Resend, set RESEND_API_KEY and TO in .env, then:
npm run sendFor any other provider, render from react-email gives you the HTML.
- Pass your own numbers as props.
- Set
mode="dark"for dark charts and colours. Charts are images with their own background, so they don't follow the reader's dark mode. - Change
themeinemails/weekly-digest.tsxto another built-in theme, or one saved in your Chartshot account.
The Chartshot docs cover every chart type and option.
MIT

