• Stars
    star
    11
  • Rank 1,694,829 (Top 34 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 8 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A task plugin for running MJML templates in Laravel Elixir

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).

Install

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');
require('elixir-mjml');

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

elixir(function(mix) {
    mix.mjml();
});

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);
});

Run

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

Author & License

The MIT License (MIT)

Copyright (c) 2016 Peter Fox

More Repositories

1

laravel-webhook-demo

The example code for the article https://medium.com/@SlyFireFox/laravel-innovations-making-your-own-webhook-mechanism-through-notifications-96e75e99a2b1
PHP
17
star
2

hexavel

A modified version of the Laravel Framework
PHP
7
star
3

openai-laravel-demo

A demo app for using OpenAI with Laravel
PHP
7
star
4

macros-demo

A Demo for Macros
PHP
7
star
5

nova-social-login-demo

A demo for how to implement Social Logins for Laravel Nova
PHP
5
star
6

laravel-runscope

A PHP library for making it easy to use Runscope with your web hooks and external API calls
PHP
5
star
7

notifications-demo

The code in this project is an example of how to create a simple streamlined email unsubscribe mechanism for Laravel's notification system
PHP
5
star
8

hieroglyph

A package to simplify changing between different icon sets
PHP
3
star
9

roadrunner-plugin-template

Template project for a RoadRunner plugin
Go
3
star
10

bitpayclient

An OOP PHP client for interacting with the BitPay API
PHP
2
star
11

validation-rule-demo

The example code for the article https://medium.com/@SlyFireFox/test-driven-development-for-custom-laravel-validation-rules-669d01e34a65
PHP
2
star
12

seo-demo

The code in this project is an example of how to create root level URLs for dynamic content without causing wildcard clashes
PHP
2
star
13

make-command-demo

A demo for making new Make commands in Laravel
PHP
2
star
14

laravel-incident-logs-demo

The example code for the article https://medium.com/@SlyFireFox/laravel-how-to-make-incident-logs-d7fa88e48490
PHP
2
star
15

hexavel-spark

A library for making installs of Spark compatible with Laravel Spark
PHP
1
star
16

torino

An example of a simple Onion address generator
JavaScript
1
star
17

graphaware-reco-client-php

A configurable PHP library for fetching recommendations from a GraphAware Recommendation setup
PHP
1
star
18

waitformysql

A mini golang util for waiting for a mysql database to be up
Go
1
star
19

laravel-casts-examples

A demo for Laravel Custom Casts with common examples for Money, Location/Address and Date Intervals
PHP
1
star
20

testing-trait-hooks-demo

Demo for Trait hooks to use in Test Cases
PHP
1
star
21

custom-make-model-command

A demo for customising the Laravel make model command to use singular table names.
PHP
1
star