2017 © Pedro Peláez
 

yii2-extension yii2-postman

Mail module for Yii2.

image

rmrevin/yii2-postman

Mail module for Yii2.

  • Wednesday, May 3, 2017
  • by rmrevin
  • Repository
  • 7 Watchers
  • 27 Stars
  • 3,336 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 12 Forks
  • 3 Open issues
  • 34 Versions
  • 5 % Grown

The README.md

Mail Extension for Yii2

Installation

In composer.json:, (*1)

{
    "require": {
        "rmrevin/yii2-postman": "~2.2"
    }
}

configuration

/config/web.php, (*2)

<?
return [
    // ...
    'components' => [
        // ...
        'postman' => [
            'class' => 'rmrevin\yii\postman\Component',
                'driver' => 'smtp',
                'default_from' => ['mailer@somehost.com', 'Mailer'],
                'subject_prefix' => 'Sitename / ',
                'subject_suffix' => null,
                'table' => '{{%postman_letter}}',
                'view_path' => '/email',
                'smtp_config' => [
                    'host' => 'smtp.domain.cpom',
                    'port' => 465,
                    'auth' => true,
                    'user' => 'email@domain.cpom',
                    'password' => 'password',
                    'secure' => 'ssl',
                    'debug' => false,
                ]
        ],
    ],
    // ...
];

If you want use SMTP without ssl and tsl ```php <? return [ // ... 'components' => [ // ... 'postman' => [ 'class' => 'rmrevin\yii\postman\Component', // ... 'smtp_config' => [ // ... 'secure' => '', 'smtpAutoTls' => false, ] ], ], // ... ];, (*3)


Updating database schema ------------- After you downloaded and configured yii2-postman, the last thing you need to do is updating your database schema by applying the migrations: In `/config/console.php`: ```php <? return [ // ... 'components' => [ // ... 'postman' => [ 'class' => 'rmrevin\yii\postman\Component', ], ], // ... ];

In Command line:, (*4)

php yii migrate/up --migrationPath=@vendor/rmrevin/yii2-postman/migrations/

Usage

<?
// ...
(new \rmrevin\yii\postman\RawLetter())
    ->setSubject('Subject')
    ->setBody('Message body')
    ->addAddress('user@somehost.com')
    ->addBccAddress(['tech@somehost.com']);
if(!$Letter->send()){
    echo $Letter->getLastError();
}

// path to view algorithm:
// Yii::$app->controller->module->getViewPath() . Postman::$view_path . '/' . 'message-view.php'
// path to view: /protected/views/email/message-view.php
(new \rmrevin\yii\postman\ViewLetter)
    ->setSubject('Subject')
    ->setBodyFromView('letter-view', [
        'name' => 'Rosy',
        'date' => date('Y-m-d')
    ])
    ->addAddress(['user@somehost.com', 'John Smith'])
    ->addAttachment('/path/to/file.tar.gz');
if(!$Letter->send()){
    echo $Letter->getLastError();
}

Cron

In cron script:, (*5)

LetterModel::cron($num_letters_per_step = 10)

The Versions

03/05 2017

dev-master

9999999-dev

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

mail email yii2 queue phpmailer sending

03/05 2017

2.4.0

2.4.0.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

mail email yii2 queue phpmailer sending

25/03 2016

2.3.0

2.3.0.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

mail email yii2 queue phpmailer sending

21/05 2015

2.2.4

2.2.4.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

20/05 2015

2.2.3

2.2.3.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

20/05 2015

2.2.2

2.2.2.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

13/05 2015

2.2.1

2.2.1.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

13/05 2015

2.2.0

2.2.0.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

13/05 2015

2.1.2

2.1.2.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

13/05 2015

2.1.1

2.1.1.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

04/03 2015

2.1.0

2.1.0.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

23/12 2014

2.0.3

2.0.3.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

23/12 2014

2.0.2

2.0.2.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

25/11 2014

2.0.1

2.0.1.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

25/11 2014

2.0.0

2.0.0.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 queue phpmailer sending

27/02 2014

1.3.1

1.3.1.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

27/02 2014

1.3.0

1.3.0.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

03/02 2014

1.2.x-dev

1.2.9999999.9999999-dev

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

03/02 2014

1.2.0

1.2.0.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

29/11 2013

1.1.x-dev

1.1.9999999.9999999-dev

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

29/11 2013

1.1.10

1.1.10.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

29/11 2013

1.1.9

1.1.9.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

21/11 2013

1.1.8

1.1.8.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

21/11 2013

1.1.7

1.1.7.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

20/08 2013

1.1.6

1.1.6.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

07/08 2013

1.1.5

1.1.5.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

07/08 2013

1.1.4

1.1.4.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii2 phpmailer sending

07/08 2013

1.1.3

1.1.3.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii phpmailer

08/07 2013

1.1.2

1.1.2.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii phpmailer

02/07 2013

1.1.1

1.1.1.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii phpmailer

10/06 2013

1.1.0

1.1.0.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii phpmailer

10/06 2013

1.0.x-dev

1.0.9999999.9999999-dev

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii phpmailer

06/06 2013

1.0.0

1.0.0.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii phpmailer

06/06 2013

1.0.1

1.0.1.0

Mail module for Yii2.

  Sources   Download

BSD-3-Clause

The Requires

 

mail email yii phpmailer