Downloads
Stars
Version
This is a laravel package that allows to configure email templates and update them through the admin panel
requirements: laravel 5.5 and above
Install the package using composer
composer require alliance/laravel-email-template
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
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
];