dev-master
9999999-devCreate and Edit mail templates
GPL-3.0+
The Requires
by Tushar Ugale
extension yii2
Create and Edit mail templates
Create and Edit mail templates, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist tusharug/yii2-mail-templates "*"
or add, (*4)
"tusharug/yii2-mail-templates": "*"
to the require section of your composer.json
file., (*5)
Add mailtemplates to modules in web.php, (*6)
$config['modules']['mailtemplates'] = [ 'class' => 'tusharug\mailtemplates\Template', ];
Create tables by running following migration command, (*7)
php yii migrate --migrationPath=@vendor/tusharug/yii2-mail-templates/migrations/
Send Mail using Template, (*8)
use tusharug\mailtemplates\components\MailTemplateManager; $data = array( 'key1'=>'Value1', 'key2'=>'Value2', 'key3'=>'Value3', ); $template = new MailTemplateManager(); $template->setTemplate('template_code', $data);
Get Subject, (*9)
$template->getSubject();
Get Body, (*10)
$template->getBody();
You should manage access of following links., (*11)
Developer / Admin Link - Will be used to create, update, delete Templates, (*12)
http://www.yourapp.com/index.php?r=mailtemplates
End User Link -Will be used only for editing templates., (*13)
http://www.yourapp.com/index.php?r=mailtemplates/user
Create and Edit mail templates
GPL-3.0+
extension yii2