LoginSignup
19
20

More than 5 years have passed since last update.

レスポンシブなHTMLメールフレームワークを使う

Posted at

mjml

レスポンシブなHTMLメールを作成するためのフレームワーク。

mjmlの中身は、Reactで書かれていて、mjmlで用意されているComponentを使って
文書を作成し、mjmlでコンパイルすると、レスポンシブで様々なクライアントに対応した
レスポンシブなHTMLが出力されます。

Github: mjmlio/mjml
Website: https://mjml.io/

インストール

$ npm install mjml --save-dev

mjml文書作成

hello.mjml
<mj-body>
  <mj-section>
    <mj-column>
      <mj-text>
        Hello World!
      </mj-text>
    </mj-column>
  </mj-section>
</mj-body>

コンパイル

  • 即時実行
$ ./node_modules/.bin/mjml -r hello.mjml
  • ファイルの変更をウォッチして自動でコンパイル
$ ./node_modules/.bin/mjml -w hello.mjml

テンプレート

多彩なテンプレートも用意されています。
随時追加されているようです。

表示確認

月額:$45
1週間フリートライアル有り

月額:$79
フリー有り(検証クライアントが限定されています)

19
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
20