Code Monkey home page Code Monkey logo

ndli-email's Introduction

MailChimp Template - This Week in Lucy

MailChimp Template Tags

[https://templates.mailchimp.com/getting-started/template-language/]

mc:edit="header" Use this to name your email header.

mc:label="header" Label is not required.

mc:hideable Can be added to any html element to allow a element tot be hidden.

mc:repeatable Is used to provide a duplication action for a particular element within a template.

Loading Google Fonts

Uses custom fonts. Uses Google Font with link and @import Google Fonts:

<link href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@700&display=swap" rel="stylesheet">

<style>
    @import url('https://fonts.googleapis.com/css2?family=Roboto+Condensed:wght@700&display=swap');

    .font-family-roboto-condensed{
      font-family: 'Roboto Condensed', sans-serif;
    }
    </style>

Developer notes

mailwind package used for implmenting email design. See the github page: yesandagency.github.io/ndli-email/

mailwind --input-html email.html --output-html index.html

https://stackshare.io/mailwind

Install

npm install -g mailwind

Usage

Design your HTML email using the Tailwind utility classes like you normally would for the web.

Then run the following command to generate the corresponding CSS file:

mailwind --input-html email.html --output-css style.css

Or run this command to generate an inlined HTML file:

mailwind --input-html email.html --output-html index.html

Options

--input-css

The path to your base CSS file. Use this if you need to write custom CSS. Defaults to style.css.

--input-html

The path to your HTML email file.

--output-css

The path to the CSS file that will be generated.

--output-html

The path to the inlined HTML file that will be generated.

--tailwind-config

The path to your custom Tailwind configuration file. Defaults to tailwind.config.js.

Note

In the provided default config file, all the units are changed to pixel which is probably what you want for HTML emails.

Example

Given an email.html file with this content:

<html>
  <body>
    <p class="font-bold text-lg">Welcome</p>
  </body>
</html>

running this command:

mailwind \
  --input-html email.html \
  --output-css style.css \
  --output-html email-inlined.html

will generate the following CSS and inlined HTML files:

.text-lg {
  font-size: 18px
}

.font-bold {
  font-weight: 700
}
<html>
  <body>
    <p class="font-bold text-lg" style="font-size: 18px; font-weight: 700;">Welcome</p>
  </body>
</html>

ndli-email's People

Contributors

yes-nathan avatar

Watchers

Daniel Johnson avatar Jonah Cohen avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.