0.0.25 • Published 6 years ago

@ftw/email-builder v0.0.25

Weekly downloads
24
License
MIT
Repository
-
Last release
6 years ago

Email Builder

A React-based tool for building modern, responsive email templates which degrade "gracefully" in older clients.

Getting Started

  1. Create a "package.json" file (yarn init)
  2. Run yarn add "@ftw/email-builder" "react@>=16.3 <17" "react-dom@>=16.3 <17"
  3. Add a "start" script to your "package.json":
    {
      "scripts": {
        "start": "email-builder develop"
      }
    }
  4. Create an "emails/EMAIL_NAME" directory and add an index.js file as an entry point for your email:

    // emails/newsletter/index.js
    
    import * as React from 'react';
    import { Email, Section, renderEmail } from '@ftw/email-builder';
    
    function Newsletter() {
      return (
        <Email>
          <Section align="center">
            <Section
              maxWidth={650}
              padding={{ top: 50, bottom: 80, left: 20, right: 20 }}
            >
              Hello world!
            </Section>
          </Section>
        </Email>
      );
    }
    
    renderEmail(Newsletter);
  5. Run yarn start in your project directory and open http://localhost:5000 in your browser.