Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/peterfox/laravel-elixir-mjml
A task plugin for running MJML templates in Laravel Elixir
https://github.com/peterfox/laravel-elixir-mjml
Last synced: 19 days ago
JSON representation
A task plugin for running MJML templates in Laravel Elixir
- Host: GitHub
- URL: https://github.com/peterfox/laravel-elixir-mjml
- Owner: peterfox
- License: mit
- Created: 2016-05-16T16:01:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-14T11:03:21.000Z (over 7 years ago)
- Last Synced: 2024-10-11T20:46:37.762Z (about 1 month ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 11
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
Laravel Elixir MJML
==================[MJML](https://mjml.io/documentation/#getting-started) 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](https://laravel.com/docs/5.2/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:
```ssh
npm install --save-dev elixir-mjml
```Then edit your gulpfile.js to contain the following:
```javascript
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:
```javascript
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](http://www.peterfox.me)