Skip to content

A simple microservice template created to use the react-email package from an API with express & zod.

Notifications You must be signed in to change notification settings

HasanQQ/react-email-microservice

Repository files navigation

React Email Microservice

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.

Commands

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.

Example Usage

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": "..."
    }
}

TODOs

  • zod implementation for request payloads
  • automatic template/file discovery for express side
  • move core functions/files into a package

About

A simple microservice template created to use the react-email package from an API with express & zod.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •