1. Go to this page and download the library: Download songyue/yii2-message 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/ */
songyue / yii2-message example snippets
'modules' => [
'message' => [
'class' => 'songyue\message\Module',
'userModelClass' => '\app\models\User', // your User model. Needs to be ActiveRecord.
],
],
'mailMessages' => function ($user) {
return $user->profile->receive_emails === true;
},
'useMailQueue' => true,
'recipientsFilterCallback' => function ($users) {
return array_filter($users, function ($user) {
return !$user->isAdmin;
});
},