Looking to hire Laravel developers? Try LaraJobs

laravel-mjml maintained by zerdo

Description
A Laravel package that allows you to integrate with the MJML seamlessly.
Author
Last update
2020/09/06 22:07 (dev-master)
Links
Downloads
7

Comments
comments powered by Disqus

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