2017 © Pedro Peláez
 

yii2-extension yii2-email-templates

Extension for creating of email templates and manage using your site dashboard

image

yiimaker/yii2-email-templates

Extension for creating of email templates and manage using your site dashboard

  • Monday, June 25, 2018
  • by greeflas
  • Repository
  • 14 Watchers
  • 71 Stars
  • 1,775 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 15 Forks
  • 1 Open issues
  • 15 Versions
  • 27 % Grown

The README.md

Stand With Ukraine, (*1)

, (*2)

Email templates module


Extension for creating email templates and managing by using your site dashboard. You can create email templates with CRUD module in your backend or Gii generator., (*3)

Documentation is at docs/guide/README.md., (*4)

Build Status Scrutinizer Code Quality Total Downloads Latest Stable Version StandWithUkraine, (*5)

Installation

The preferred way to install this extension is through composer., (*6)

Either run, (*7)

$ composer require yiimaker/yii2-email-templates

or add, (*8)

"yiimaker/yii2-email-templates": "~4.1"

to the require section of your composer.json., (*9)

Usage

  1. Create template with placeholders using your site dashboard or Gii generator, (*10)

    Key

    register-notification - this is unique key of this template for using in your code, (*11)

    Subject

    Notification from {site-name}, (*12)

    In this example email subject has one placeholder {site-name}, (*13)

    Body

    Hello, {username}! Welcome to {site-name} :), (*14)

    Email body has two placeholders: {username} and {site-name}., (*15)

    All keys should be wrapped by {}., (*16)

  2. Now you can get this template in your code, (*17)

    $template = Yii::$app->get('templateManager')->getTemplate('register-notification');
    

    This method returns a template model object., (*18)

  3. Then you should parse this template, (*19)

    $template->parseSubject([
       'site-name' => Yii::$app->name,
    ]);
    
    $template->parseBody([
       'username' => Yii::$app->getIdentity()->username,
       'site-name' => Yii::$app->name,
    ]);
    

    or use another method, (*20)

    $template->parse([
       'subject' => [
           'site-name' => Yii::$app->name,
       ],
       'body' => [
           'username' => Yii::$app->getIdentity()->username,
           'site-name' => Yii::$app->name,
       ],
    ]);
    

    this methods replace placeholders in template with real data., (*21)

  4. Now you can use data of this template in your logic, (*22)

    Yii::$app->get('mailer')->compose()
        ->setSubject($template->subject)
        ->setHtmlBody($template->body)
        // ...
    

Tests

You can run tests with composer command, (*23)

$ composer test

or using following command, (*24)

$ codecept build && codecept run

Contributing

For information about contributing please read CONTRIBUTING.md., (*25)

Sponsoring

Buy Me A Coffee, (*26)

License

License, (*27)

This project is released under the terms of the BSD-3-Clause license., (*28)

Copyright (c) 2017-2022, Yii Maker, (*29)

The Versions

25/06 2018

dev-master

9999999-dev

Extension for creating of email templates and manage using your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates placeholders

24/06 2018

v4.1.0

4.1.0.0

Extension for creating of email templates and manage using your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates placeholders

24/06 2018

4.1.x-dev

4.1.9999999.9999999-dev

Extension for creating of email templates and manage using your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates placeholders

29/05 2018

4.0.x-dev

4.0.9999999.9999999-dev

Extension for creating of email templates and manage using your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates placeholders

23/05 2018

v4.0.1

4.0.1.0

Extension for creating of email templates and manage using your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates placeholders

22/04 2018

v4.0.0

4.0.0.0

Extension for creating of email templates and manage using your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates placeholders

22/01 2018

3.0.1

3.0.1.0

Extension for creating of email templates and manage using your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates placeholders

22/12 2017

3.0.0

3.0.0.0

Extension for creating of email templates and manage using your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates placeholders

13/09 2017

2.1.0

2.1.0.0

Extension for creating of email templates and manage accross your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates

11/09 2017

2.0.0

2.0.0.0

Extension for creating of email templates and manage accross your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates

15/08 2017

1.1.1

1.1.1.0

Extension for creating of email templates and manage accross your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates

01/08 2017

1.1.0

1.1.0.0

Extension for creating of email templates and manage accross your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 gii module templates

27/07 2017

1.0.2

1.0.2.0

Extension for create and use email templates across your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 module templates

22/06 2017

1.0.1

1.0.1.0

Extension for create and use email templates across your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 module templates

14/06 2017

1.0.0

1.0.0.0

Extension for create and use email templates across your site dashboard

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Vladimir Kuprienko

email yii2 module templates