Skip to content

peaceall236/LaravelEmailTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

LaravelEmailTemplate

This is a laravel package that allows to configure email templates and update them through the admin panel

requirements: laravel 5.5 and above

Instructions

Step 1: Installation

Install the package using composer

composer require alliance/laravel-email-template

Step 2: Configuration

Go to your laravel resources folder and create a folder that will contain your email

cd resources/views
mkdir -p email-template/template1 email-template/template2

Publish package files. Run the following command

php artisan vendor:publish

Open the config file and add your configurations

vim app/config/laravelemailtemplate.php

Schedule your laravel app to run the extract command every minute

vim app/Console/Kernel.php

Inside the schedule() function. Add the following line.

$schedule->command('laravelemailtemplate:extract')->everyMinute()

For more details on scheduling. Check laravel documentation

Usage

Every email you want to allow the admin to update, you have to add it to the config file.

The config example:

return [
    // ... some configs
    templates => [
        [
            "name" => "template1", // template name
            "variables" => ["variable1", "variable2"], // available placeholders to be considered for the template
            "folder" => "email-template/template1", // path inside resources/views, NB: Each Template must have its own folder
            "entry_file" => "template.php" 
        ]
    ],
    // ... more configs
];

About

Create Semi-dynamic email template admin panel for laravel

Resources

Stars

Watchers

Forks

Packages

No packages published