The preferred way to install this extension is through composer.
Either run
$ composer require yiimaker/yii2-email-templates
or add
"yiimaker/yii2-email-templates": "~4.1"
to the require
section of your composer.json
.
// console/config/main.php
'controllerMap' => [
'migrate' => [
'class' => yii\console\controllers\MigrateController::class,
'migrationNamespaces' => [
// ...
'ymaker\email\templates\migrations',
],
],
],
To use this extension, simply add the following code in your application configuration:
'modules' => [
// ...
'email-templates' => [
'class' => \ymaker\email\templates\Module::class,
'languageProvider' => [
'class' => \motion\i18n\ConfigLanguageProvider::class,
'languages' => [
[
'locale' => 'en',
'label' => 'English',
],
// ...
],
'defaultLanguage' => [
'locale' => 'en',
'label' => 'English',
],
],
],
]
'components' => [
// ...
'templateManager' => [
'class' => \ymaker\email\templates\components\TemplateManager::class,
],
]