Get Started

Here you can find the guide on how to use laravel mail editor (aka Maileclipse).

Installation

Requirements

  • PHP: ^7.1.3
  • Laravel: ^5.6

Installation

Require this package in the composer.json of your Laravel project. This will download the package


                composer require qoraiche/laravel-mail-editor
              
            

The qoraiche\mailEclipse\mailEclipseServiceProvider is auto-discovered and registered by default, but if you want to register it yourself:

Add the ServiceProvider in config/app.php


                'providers' => [
                    /*
                     * Package Service Providers...
                     */
                    qoraiche\mailEclipse\mailEclipseServiceProvider::class,
                ]

              
            

To publish the config, run the vendor publish command:


                php artisan vendor:publish --provider="qoraiche\mailEclipse\mailEclipseServiceProvider"
              
            

This will create a new config file named config/maileclipse.php

Configuration

The configuration file contains all options needed to customize the package, the following table has each option documented:

Options Description Default
path This is the URL where you can access maileclipse interface. maileclipse
mailables_dir Application mailables directory. Default laravel mailables directory
factory Use elequent factory to show previews fake data. true
allowed_environments Allowed application environments. local, staging, testing
middlewares The value should be an array of fully qualified class names of the middleware classes. example auth or \App\Http\Middleware\Authenticate::class empty
skeletons This option contains an array of all pre-built HTML and markdown templates. templates array

Usage

The best way to get an idea of what this package does is to install it and try it out or check out this six-minute demo from the author:

Templates

All email templates are stored in the following directory: resources/views/vendor/maileclipse/templates, don't worry if you don't see this directory in your application, since it will be generated for you when you create your first template.

View Data

There are two ways you may make data available to your view. First, any public property defined on your mailable class will automatically be made available to the view, or you may manually pass your data to the view via the with method, for more details checkout out laravel mail documentation.

All mailable view data will be available to you above the template editor so you can easily add data to the editor:

View data GIF image

Support

Our software is free and open source, meaning that the use of our software is optional. We hold no liability and there is no obligation to support. We will provide support on a best effort basis.

License

Our software is open source and licensed under the MIT license . You are free to use the software as you like. The code can be forked and modified, but the original copyright author should always be included! #