zerdo/laravel-mjml

There is no license information available for the latest version (0.0.1) of this package.

A Laravel package that allows you to integrate with the MJML seamlessly.

0.0.1 2020-05-22 22:10 UTC

README



composer require zerdo/laravel-mjml


Basic Usage

MJMLChannel

Use MJMLChannel when you want to send a email via the MJML api.

<?php

use Zerdo\LaravelMJML\MJMLChannel;

class OrderNotification extends Notification implements ShouldQueue {
    ...

    public function via()
    {
        return [MJMLChannel::class];
    }
}
MJMLMessage

Use MJMLMessage when you want to construct a blade view using MJML components.

<?php

use Zerdo\LaravelMJML\MJMLMessage;

class OrderNotification extends Notification implements ShouldQueue {
    ...
    public function toMail()
    {
        return (new MJMLMessage)->subject('...')->mjml('emails.mjml-template');
    }
}

###Usage for Lumen This package does work with Lumen but there is an extra step that you have to take.

  • Navigate to bootstrap/app.php.
  • Add the following line: $app->configure('laravel-mjml');