Giter VIP home page Giter VIP logo

laravel-mjml's Introduction

Laravel MJML

Build responsive e-mails easily using MJML and Laravel Mailables.

MJML

MJML is an awesome tool from MailJet that allows us to create responsive emails very easily. For more information on how to use it, head to their documentation here

Installation

To install this package, require this package using composer as follows:

composer require asahasrabuddhe/laravel-mjml

After composer installs the packages and all the dependencies, publish the package configuration using artisan command:

php artisan vendor:publish

Select the laravel-mjml in the list. You will also need to install the MJML CLI:

npm install --save mjml

Getting Started

  1. Create a view containing MJML in your resources/views directory.

  2. Create a mailable class using artisan command: php artisan make:mail MJMLEmail

  3. In the mailable class, replace

    use Illuminate\Mail\Mailable;

    with

    use Asahasrabuddhe\LaravelMJML\Mail\Mailable;

  4. In the build method, use: $this->mjml('view.name');

Configuration

By default, the package will automatically detect the path of the MJML CLI installed locally in the project. In case this does not happen or the MJML CLI is installed globally, please update the configuration file likewise.

That's it! You have successfully installed and configured the MJML package for use. Just create new views and use them in the mailables class.

laravel-mjml's People

Contributors

asahasrabuddhe avatar dependabot-preview[bot] avatar dependabot[bot] avatar gabestah avatar jimping avatar madina972 avatar mbardelmeijer avatar morales2k avatar odinti avatar oszilloraptor avatar therooster-pixels avatar umihico avatar vanderb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.