Tool for rendering multilingual templates sent to E-mail
Go to file
SleepWalker b746a4967b Fix hmr
2016-09-10 13:58:57 +03:00
scripts Support of styling and i18n 2016-09-04 12:19:14 +03:00
src Fix hmr 2016-09-10 13:58:57 +03:00
webpack-utils README. Clean up. Images usage demo 2016-09-04 19:24:50 +03:00
.babelrc Hello World 2016-08-28 16:41:15 +03:00
.eslintrc.json Support of styling and i18n 2016-09-04 12:19:14 +03:00
.gitignore Adjust gitignore for production needs 2016-09-04 18:52:24 +03:00
package.json README. Clean up. Images usage demo 2016-09-04 19:24:50 +03:00
README.md README. Clean up. Images usage demo 2016-09-04 19:24:50 +03:00
webpack.config.js README. Clean up. Images usage demo 2016-09-04 19:24:50 +03:00

This package allows rendering of React components into plain HTML to use it in emails. Each directory in emails dir corresponds to separate email template. Each email component will receive payload, passed from command line:

node cli --type=<email_dir_name> --payload=<json_encoded_in_base64>

Try php example.php for demo.

Email component structure

  • index.js — required. This file should export the main component, wich will receive payload.
  • fixtures.js — an optional file exports hash {featureId: payload, featureId2: payload}. Use this to create data samples for testing in dev mode.
  • styles.js — an optional file, that will hold style objects for email components to allow style inlining.
  • messages.intl.json — an optional file, that exports hash with {messageId: defaultMessage} for react-intl.

Available npm scripts

  • npm start — starts app in dev mode.
  • npm run i18n — collects translations and places in src/i18n.
  • npm run build — builds app for usage in cli.js.
  • npm run eslint — lints source files.