PHP code example of pcrt / yii2-notify

1. Go to this page and download the library: Download pcrt/yii2-notify library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pcrt / yii2-notify example snippets



'components' => [
    'notification' => [
      'class' => 'pcrt\component\Notification',
      'mainpath' => '/mail/template/',
      'overridepath' => '/mail/override/',
      'notifier_email' => '[email protected]'
    ],
    ....
    ....
  ]


'log' => [
    'targets' => [
        [
            'class' => 'yii\log\FileTarget',
            'levels' => ['info', 'error', 'warning'],
            'categories' => ['notification'],
            'logVars' => [],
            'logFile' => '@runtime/logs/notification.log',
        ],
        ...
        ...
    ],
],


  Yii::$app->notification->send('test', [], '[email protected]', 'test');


$ php composer.phar