How to use the mjml/lib/mjml2html function in mjml

To help you get started, we’ve selected a few mjml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mjmlio / mjml-app / app / actions / template.js View on Github external
export const createNewTemplate = () => dispatch => {
  const newTemplate = Map({
    id: shortid.generate(),
    name: 'no name',
    mjml: defaultContent,
    html: mjml2html(defaultContent),
    creationDate: new Date()
  })
  dispatch(setTemplate(newTemplate))
  dispatch(saveTemplate())
  dispatch(push('editor'))
}
github mjmlio / mjml-app / app / actions / template.js View on Github external
export const saveTemplate = () => (dispatch, getState) => {
  const state = getState()
  const { template, config } = state

  const html = mjml2html(template.get('mjml'))
  save(
    template.set('html', html),
    config.get('projectDirectory')
  )
}

mjml

MJML: the only framework that makes responsive-email easy

MIT
Latest version published 3 months ago

Package Health Score

83 / 100
Full package analysis