A task plugin for running MJML templates in Laravel Elixir
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2c5b214 May 16, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore Initial commit May 16, 2016
LICENSE.txt Initial commit May 16, 2016
README.md Initial commit May 16, 2016
index.js Initial commit May 16, 2016
package.json Initial commit May 16, 2016


Laravel Elixir MJML

MJML is a cool little tool for making responsive and inlined emails in a simplier fashion. This library simply allows you to use it in Laravel Elixir with zero fuss. Converting any .mjml templates into blade files (please bare in mind blade markup found in mjml files may sometimes break and it's best to stick to simple variable echos).


In your Laravel Project's base folder run:

npm install --save-dev elixir-mjml

Then edit your gulpfile.js to contain the following:

var elixir = require('laravel-elixir');

elixir.config.email = {
    mjml: {
        folder: 'mjml'

elixir(function(mix) {

All the MJML should be placed in a folder called mjml inside the assets folder. When the gulp task is run it will create the output blade files in your view resources folder. The folder structure and files will be placed in keeping to where your mjml is e.g. email/test.mjml will be made into email/test.blade.php, this act will overwrite previous templates if the files match.

You can modify the src, output and engine of the task in your gulpfile.js, like so:

var mjmlEngine = require('mjml')

elixir(function(mix) {
    mix.mjml('**/*.mjml', 'resources/views', mjmlEngine);


Simply run gulp or gulp mjml to make the magic happen.

Author & License

The MIT License (MIT)

Copyright (c) 2016 Peter Fox