Download the PHP package daylaborers/laravel-mjml without Composer

On this page you can find all versions of the php package daylaborers/laravel-mjml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-mjml

Laravel MJML

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

MJML

MJML is a markup language, from MailJet, that reduces the effort required to develop responsive emails. For more information, have a look at the documentary.

Installation

To install this package, run this composer command:

composer require dayLaborers/laravel-mjml

After composer installs the packages, you can publish the package configuration using artisan command:

php artisan vendor:publish --tag=mjml-config

Configuration

There are two options, to render MJML:

The desired procedure can be configured via the environment variable MJML_PROCEDURE. Default is api.

API procedure

To render MJML via the API, you must set the following environment variables:

You can also omit MJML_PROCEDURE, as the default value is api. The API credentials can request here

CLI procedure

If you prefer not to render MJML via the API, you can use the NPM package. You must install this in advance and set the following enviroment variables:

MJML_CLI_PATH has the default value node_modules/.bin/mjml, you only need to set this variable if the path to your MJML package differs.

Example

Now you can use MJML for your Laravel Mails. For example, you can use MJML to verify the email after registration. To use Email Verification in your Laravel App, see the documentation here.

Add an MJML Template to your ressource path:

resources\views\emails\notifications\verify.mjml.blade.php

The Template File must have the mjml.blade.php extension.

If you want to use Blade directives, you must wrapped this in mj-raw tags:

Create a Mailable

To create a Mailable use the artisan command: php artisan make:mail VerifyEmail

Customize the class

In your Mailable class generated by laravel, you must now adjust the following:

Of course, you can pass more variables and customize things as described in the Laravel documentation.

Customize the email verification

Open the AppServiceProvider.php class and add this:

Now the verification Mail is rendered with MJML.

That's it! You have successfully installed and configured the MJML package for use.


All versions of laravel-mjml with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2.0
ext-libxml Version *
ext-dom Version *
soundasleep/html2text Version ^2.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package daylaborers/laravel-mjml contains the following files

Loading the files please wait ....