Downloads
Stars
Version
The Laravel Nova Mail Editor allows you to easily edit the content of your transactional mails.
This package provides a Nova tool for the Laravel Mail Template Engine. Check the documentation of the Laravel Mail Template Engine for more info.
For the entire list of features take a look at the documentation of the Laravel Mail Template Engine.
The package can be installed through Composer.
composer require statikbe/laravel-nova-mail-editor
Next enable the tool in Nova.
Go to app/Providers/NovaServiceProvider.php
and add the Mail Editor to the tools.
use Statikbe\NovaMailEditor\MailEditor;
public function tools()
{
return [
new MailEditor,
];
}
There are two ways to change the supported locales.
Publish the config file with the command below and configure it with your supported locales.
php artisan vendor:publish --tag=nova-mail-editor
E.g.
/*
|--------------------------------------------------------------------------
| Mail editor supported locales
|--------------------------------------------------------------------------
|
| The application locale determines the possible locales that can be used.
| You are free to fill this array with any of the locales which will be
| supported by the editor.
|
|
*/
'supported_locales' => [
'en',
],
If your application already has a config that declares your locales then you are able to set the supported locales in
any service provider. Create a new one or use the app/Providers/AppServiceProvider.php
and set the supported locales
as an array in the boot function as follows:
use Statikbe\NovaMailEditor\MailEditor;
public function boot()
{
$locales = ['en', 'nl']; //Or any other way of retrieving the locales;
MailEditor::setLocales($locales);
}
A third non official option is to use a new config key in your app.php
config. The key you can use is supported_locales
, as in our own config. We provide this method to have a global config key of supported locales. Our translatable packages will try to use this key.
More information about the mail template config can be found in the base package: Laravel Mail Template Engine.
The MIT License (MIT). Please see license file for more information.