2017 © Pedro Peláez
 

library laravel-mjml

A package that enables using MJML with Laravel Mailables.

image

asahasrabuddhe/laravel-mjml

A package that enables using MJML with Laravel Mailables.

  • Thursday, July 12, 2018
  • by asahasrabuddhe
  • Repository
  • 0 Watchers
  • 5 Stars
  • 271 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 2 Open issues
  • 8 Versions
  • 2364 % Grown

The README.md

Laravel MJML

Build responsive e-mails easily using MJML and Laravel Mailables., (*1)

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, (*2)

Installation

To install this package, require this package using composer as follows:, (*3)

composer require asahasrabuddhe/laravel-mjml, (*4)

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

php artisan vendor:publish, (*6)

Select the laravel-mjml in the list. You will also need to install the MJML CLI:, (*7)

npm install --save mjml, (*8)

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, (*9)

    use Illuminate\Mail\Mailable;, (*10)

    with, (*11)

    use Asahasrabuddhe\LaravelMJML\Mail\Mailable;, (*12)

  4. For Laravel 8 and below, in the build method, use:, (*13)

    public function build()
    {
        return $this->mjml('view.name')
    }
    

    For Laravel 9, in the content method:, use:, (*14)

    public function content()
    {
        return new Content(
            view: $this->mjml('view.name')->buildMjmlView()['html'],
        );
    }
    

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., (*15)

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., (*16)

The Versions

12/07 2018

dev-master

9999999-dev

A package that enables using MJML with Laravel Mailables.

  Sources   Download

The Requires

 

The Development Requires

by Ajitem Sahasrabuddhe

12/07 2018

0.1.2.1

0.1.2.1

A package that enables using MJML with Laravel Mailables.

  Sources   Download

The Requires

 

The Development Requires

by Ajitem Sahasrabuddhe

11/05 2018

0.1.2

0.1.2.0

A package that enables using MJML with Laravel Mailables.

  Sources   Download

The Requires

 

The Development Requires

by Ajitem Sahasrabuddhe

11/05 2018

dev-develop

dev-develop

A package that enables using MJML with Laravel Mailables.

  Sources   Download

The Requires

 

The Development Requires

by Ajitem Sahasrabuddhe

11/05 2018

dev-analysis-8PnMdm

dev-analysis-8PnMdm

A package that enables using MJML with Laravel Mailables.

  Sources   Download

The Requires

 

The Development Requires

by Ajitem Sahasrabuddhe

11/05 2018

0.1.1

0.1.1.0

A package that enables using MJML with Laravel Mailables.

  Sources   Download

The Requires

 

The Development Requires

by Ajitem Sahasrabuddhe

11/05 2018

dev-analysis-z4QRK1

dev-analysis-z4QRK1

A package that enables using MJML with Laravel Mailables.

  Sources   Download

The Requires

 

The Development Requires

by Ajitem Sahasrabuddhe

03/05 2018

0.1.0

0.1.0.0

A package that enables using MJML with Laravel Mailables.

  Sources   Download

The Requires

 

The Development Requires

by Ajitem Sahasrabuddhe