Skip to content

Use this template to start a new doc2.email project

Notifications You must be signed in to change notification settings

doc2-site-bot/email-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Email examples with doc2.email

The resulting email HTML is optimized to work across most popular email clients including Gmail, Apple Mail and Outlook.

Demo email examples based on https://react.email/examples

Live demo

Content source

The content is provided in Google Docs see Project: https://drive.google.com/drive/folders/1uaz_fqzAD5K3giQmfumNAyhyloKUdaVm and styled via github.css.

Getting Started

First, install the doc2 CLI with npm i -g @doc2/cli, then run the doc2.email dev server:

doc2 email --dev

Open http://localhost:3000/github with your browser to see the result. Modify the styles then refresh the page to see the changes applied.

Styling and component properties

By default, doc2.email will wrap the published content with html, head, body and main tags and map them to react.email components.

The mapping of published content to react.email components is as follows :

Create a stylesheet that maps to the pathname of the requested path, for example to style a published doc at the path /X/Y/Z, create a stylesheet at /X/Y/Z.css. If the pathname is the root /, create an index.css file.

We recommend verifying with https://caniemail.com/ which CSS properties are supported across email clients.

Use query parameters to replace variables for example, the GitHub Access Token email content defines a variable named username and a link to https://github.com/{username}/tokens. By setting the query parameter ?username=doc2-site-bot, you can replace the variable with the provided value.

Deployment

The styles are deployed to GitHub Pages see https://doc2-site-bot.github.io/email-examples/github.css and proxied as defined in https://docs.google.com/spreadsheets/d/1Px85-PSykVc_Z0LIaW7SuM4x5gqi4EV2F_kF6UWIK0w/edit#gid=221884602.

Resources

To learn more, take a look at the following resources:

About

Use this template to start a new doc2.email project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages