npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

cozy-mjml

v0.14.0

Published

Use MJML custom components for Cozy emails

Downloads

26

Readme

Cozy-MJML

Cozy-MJML is used for emails. It brings some custom components for MJML that we want to share between several projects (cozy-stack, clouderery, notifications, etc.).

How it works?

Cozy-MJML exposes a single binary that behave like mjml CLI. The goal is to replace the mjml binary by this one on the cloudery: it will allow to use our custom MJML components with mjml-rails, even if the mjml CLI doesn't support custom components and mjml-rails has some expectations (like the version number of the CLI tools). This binary will also be used by the cozy-stack to generate HTML mails: the stack will run it like a konnector or a service.

I've had to put some hacks in the src/hacks directory and in the webpack config to make the bundled version works. I'm not proud of that, if you suggestion on how to improve that, please, let me know.

You can test in command line the output of the given example by running this command:

$ node src/index.js example.mjml

The result will be output on stdout. If you prefer to test with the bundled version, you can do:

$ yarn build && node dist/main.js example.mjml

To run the jest test:

$ yarn test

Our available classes

Our custom components

<mj-defaults>

Put this tag in the head to load the Lato font from Google APIs and make the following classes available in your mjml templates:

  • title to display the main title
  • title-h2 to display a secondary title
  • highlight to display a bold & blue text
  • primary-link to display a blue link
  • primary-button to display a big blue button (which is in fact a link)
  • content-small to get a content block with a small bottom margin (8px)
  • content-medium to get a content block with a medium bottom margin (16px)
  • content-large to get a content block with a large bottom margin (24px)
  • content-xlarge to get a content block with a xlarge bottom margin (32px)

To apply those classes, your must add an attribute mj-class to your MJML element.

<mj-text mj-class="title content-small">✉️ Confirmation de votre inscription</mj-text>

Available props

There are no props for this component.

<mj-head>
  <mj-defaults />
</mj-head>

<mj-header>

Available props

  • mycozy: bool, default false - Displays a header with MyCozy logo instead of CozyCloud logo
  • locale: en|fr, default en - Displays the MyCozy logo in english or french
<mj-header></mj-header>
<mj-header mycozy="true" locale="fr"></mj-header>

<mj-footer>

Available props

  • locale: en|fr, default en - Displays the footer texts & urls in english or french
  • instance: string - Displays the user's instance text & link instead of Cozy logo
<mj-footer></mj-footer>
<mj-footer instance="https://isabelledurand.mycozy.cloud" locale="fr"></mj-footer>