A simple microservice template created to use the react-email package. It has same examples as "create-email" (react-email) and the following features have been added.
- express implementation
- rollup plugin for static file versioning
List of available commands.
Command | Description |
---|---|
npm run dev |
Start the dev server. |
npm run build |
Build the production server with static files. |
npm run start |
Run the production server. |
After build you can send component properties to the [POST] http://localhost:3000/templates/:template/render
endpoint as a JSON body.
For example:
curl \
--request POST \
--url http://localhost:3000/templates/notion-magic-link/render \
--header 'Content-Type: application/json' \
--data '{"loginCode":"sparo-ndigo-amurt-secan"}'
Response will be something like that:
{
"message": "SUCCESS",
"body": {
"html": "...",
"text": "..."
}
}
-
zod implementation for request payloads - automatic template/file discovery for express side
- move core functions/files into a package