Skip to content

Latest commit

 

History

History
76 lines (60 loc) · 1.45 KB

installation.md

File metadata and controls

76 lines (60 loc) · 1.45 KB

Installation

Getting Composer package

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.

Configuring application

Migrations

// console/config/main.php

'controllerMap' => [
    'migrate' => [
        'class' => yii\console\controllers\MigrateController::class,
        'migrationNamespaces' => [
           // ...
           'ymaker\email\templates\migrations',
        ],
    ],
],

Backend module

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',
            ],
        ],
    ],
]

Template manager

'components' => [
    // ...
    'templateManager' => [
        'class' => \ymaker\email\templates\components\TemplateManager::class,
    ],
]